Commit 76b41cad by Iain Buclaw Committed by Iain Buclaw

d-demangle.c (dlang_call_convention): Return NULL if have reached the end of the…

d-demangle.c (dlang_call_convention): Return NULL if have reached the end of the symbol, but expected something to read.

libiberty/ChangeLog:

2015-05-16  Iain Buclaw  <ibuclaw@gdcproject.org>

	* d-demangle.c (dlang_call_convention): Return NULL if have reached the
	end of the symbol, but expected something to read.
	(dlang_attributes): Likewise.
	(dlang_function_type): Likewise.
	(dlang_type): Likewise.
	(dlang_identifier): Likewise.
	(dlang_value): Likewise.

From-SVN: r223241
parent eb058b7d
2015-05-16 Iain Buclaw <ibuclaw@gdcproject.org> 2015-05-16 Iain Buclaw <ibuclaw@gdcproject.org>
* d-demangle.c (dlang_call_convention): Return NULL if have reached the
end of the symbol, but expected something to read.
(dlang_attributes): Likewise.
(dlang_function_type): Likewise.
(dlang_type): Likewise.
(dlang_identifier): Likewise.
(dlang_value): Likewise.
2015-05-16 Iain Buclaw <ibuclaw@gdcproject.org>
* d-demangle.c (dlang_parse_string): Represent embedded whitespace or * d-demangle.c (dlang_parse_string): Represent embedded whitespace or
non-printable characters as hex or escape sequences. non-printable characters as hex or escape sequences.
* testsuite/d-demangle-expected: Add test for templates with tabs and * testsuite/d-demangle-expected: Add test for templates with tabs and
......
...@@ -185,7 +185,7 @@ static const char * ...@@ -185,7 +185,7 @@ static const char *
dlang_call_convention (string *decl, const char *mangled) dlang_call_convention (string *decl, const char *mangled)
{ {
if (mangled == NULL || *mangled == '\0') if (mangled == NULL || *mangled == '\0')
return mangled; return NULL;
switch (*mangled) switch (*mangled)
{ {
...@@ -221,7 +221,7 @@ static const char * ...@@ -221,7 +221,7 @@ static const char *
dlang_attributes (string *decl, const char *mangled) dlang_attributes (string *decl, const char *mangled)
{ {
if (mangled == NULL || *mangled == '\0') if (mangled == NULL || *mangled == '\0')
return mangled; return NULL;
while (*mangled == 'N') while (*mangled == 'N')
{ {
...@@ -280,7 +280,7 @@ dlang_function_type (string *decl, const char *mangled) ...@@ -280,7 +280,7 @@ dlang_function_type (string *decl, const char *mangled)
size_t szattr, szargs, sztype; size_t szattr, szargs, sztype;
if (mangled == NULL || *mangled == '\0') if (mangled == NULL || *mangled == '\0')
return mangled; return NULL;
/* The order of the mangled string is: /* The order of the mangled string is:
CallConvention FuncAttrs Arguments ArgClose Type CallConvention FuncAttrs Arguments ArgClose Type
...@@ -380,7 +380,7 @@ static const char * ...@@ -380,7 +380,7 @@ static const char *
dlang_type (string *decl, const char *mangled) dlang_type (string *decl, const char *mangled)
{ {
if (mangled == NULL || *mangled == '\0') if (mangled == NULL || *mangled == '\0')
return mangled; return NULL;
switch (*mangled) switch (*mangled)
{ {
...@@ -600,7 +600,7 @@ static const char * ...@@ -600,7 +600,7 @@ static const char *
dlang_identifier (string *decl, const char *mangled) dlang_identifier (string *decl, const char *mangled)
{ {
if (mangled == NULL || *mangled == '\0') if (mangled == NULL || *mangled == '\0')
return mangled; return NULL;
if (ISDIGIT (*mangled)) if (ISDIGIT (*mangled))
{ {
...@@ -1061,7 +1061,7 @@ static const char * ...@@ -1061,7 +1061,7 @@ static const char *
dlang_value (string *decl, const char *mangled, const char *name, char type) dlang_value (string *decl, const char *mangled, const char *name, char type)
{ {
if (mangled == NULL || *mangled == '\0') if (mangled == NULL || *mangled == '\0')
return mangled; return NULL;
switch (*mangled) switch (*mangled)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment