Mercurial > hg > CbC > CbC_gcc
diff libiberty/d-demangle.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
line wrap: on
line diff
--- a/libiberty/d-demangle.c Thu Oct 25 07:37:49 2018 +0900 +++ b/libiberty/d-demangle.c Thu Feb 13 11:34:05 2020 +0900 @@ -1,5 +1,5 @@ /* Demangler for the D programming language - Copyright (C) 2014-2018 Free Software Foundation, Inc. + Copyright (C) 2014-2020 Free Software Foundation, Inc. Written by Iain Buclaw (ibuclaw@gdcproject.org) This file is part of the libiberty library. @@ -939,8 +939,8 @@ if (type == 'a' || type == 'u' || type == 'w') { /* Parse character value. */ - char value[10]; - int pos = 10; + char value[20]; + int pos = sizeof(value); int width = 0; long val; @@ -991,7 +991,7 @@ for (; width > 0; width--) value[--pos] = '0'; - string_appendn (decl, &(value[pos]), 10 - pos); + string_appendn (decl, &(value[pos]), sizeof(value) - pos); } string_append (decl, "'"); } @@ -1191,6 +1191,9 @@ while (elements--) { mangled = dlang_value (decl, mangled, NULL, '\0'); + if (mangled == NULL) + return NULL; + if (elements != 0) string_append (decl, ", "); } @@ -1214,8 +1217,13 @@ 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, ", "); @@ -1243,6 +1251,9 @@ while (args--) { mangled = dlang_value (decl, mangled, NULL, '\0'); + if (mangled == NULL) + return NULL; + if (args != 0) string_append (decl, ", "); } @@ -1497,6 +1508,9 @@ while (elements--) { mangled = dlang_type (decl, mangled); + if (mangled == NULL) + return NULL; + if (elements != 0) string_append (decl, ", "); }