d-demangle.c (dlang_parse_assocarray): Correctly handle error result.

* d-demangle.c (dlang_parse_assocarray): Correctly handle error result.
     * testsuite/d-demangle-expected: Add testcase.

From-SVN: r270700
This commit is contained in:
Ben L 2019-04-30 14:39:14 +00:00 committed by Jeff Law
parent f181b8e780
commit 6c8dbbfe5c
3 changed files with 12 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2019-04-30 Ben L <bobsayshilol@live.co.uk>
* d-demangle.c (dlang_parse_assocarray): Correctly handle error result.
* testsuite/d-demangle-expected: Add testcase.
* d-demangle.c (dlang_parse_tuple): Correctly handle error result.
* testsuite/d-demangle-expected: Add testcase.

View File

@ -1217,8 +1217,13 @@ dlang_parse_assocarray (string *decl, const char *mangled)
while (elements--)
{
mangled = dlang_value (decl, mangled, NULL, '\0');
if (mangled == NULL)
return NULL;
string_append (decl, ":");
mangled = dlang_value (decl, mangled, NULL, '\0');
if (mangled == NULL)
return NULL;
if (elements != 0)
string_append (decl, ", ");

View File

@ -1322,3 +1322,7 @@ _D7__T2fnVlS8S588888888888S6S5
--format=dlang
_D1_B699999999961*
_D1_B699999999961*
# Could crash
--format=dlang
_D5__T1fVHacA6666666666_
_D5__T1fVHacA6666666666_