libiberty: prevent null dereferencing on dlang_type
libiberty/ * d-demangle.c (dlang_Type): Validate MANGLED is nonnull. * testsuite/d-demangle-expected: New test.
This commit is contained in:
parent
5481040197
commit
b3585c0836
@ -875,7 +875,7 @@ dlang_type (string *decl, const char *mangled, struct dlang_info *info)
|
||||
szmods = string_length (&mods);
|
||||
|
||||
/* Back referenced function type. */
|
||||
if (*mangled == 'Q')
|
||||
if (mangled && *mangled == 'Q')
|
||||
mangled = dlang_type_backref (decl, mangled, info, 1);
|
||||
else
|
||||
mangled = dlang_function_type (decl, mangled, info);
|
||||
|
@ -991,9 +991,12 @@ _D88
|
||||
_D5__T1aZv
|
||||
_D5__T1aZv
|
||||
#
|
||||
_D00
|
||||
_D00
|
||||
#
|
||||
--format=dlang
|
||||
_D00
|
||||
_D00
|
||||
_D01_D
|
||||
_D01_D
|
||||
#
|
||||
--format=dlang
|
||||
_D9223372036854775817
|
||||
|
Loading…
Reference in New Issue
Block a user