diff options
author | DJ Delorie <dj@redhat.com> | 2003-12-01 23:54:49 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2003-12-01 23:54:49 +0000 |
commit | 24afc00d03499454655395f80cf0edd5d6adfb05 (patch) | |
tree | 89058c0edee55657f2ff59d2753aff52c2ed0502 /libiberty/cp-demangle.c | |
parent | 13570a3db56e082b75bfe548c6f16194bdd7518b (diff) | |
download | gdb-24afc00d03499454655395f80cf0edd5d6adfb05.zip gdb-24afc00d03499454655395f80cf0edd5d6adfb05.tar.gz gdb-24afc00d03499454655395f80cf0edd5d6adfb05.tar.bz2 |
merge from gcc
Diffstat (limited to 'libiberty/cp-demangle.c')
-rw-r--r-- | libiberty/cp-demangle.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index bd67958..0fe568f 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -3324,7 +3324,7 @@ d_print_cast (dpi, dc) /* It appears that for a templated cast operator, we need to put the template parameters in scope for the operator name, but not for the parameters. The effect is that we need to handle - the template printing here. FIXME: Verify this. */ + the template printing here. */ hold_dpm = dpi->modifiers; dpi->modifiers = NULL; @@ -3456,6 +3456,11 @@ d_demangle (mangled, options, palc) else dc = d_type (&di); + /* If we didn't consume the entire mangled string, then we didn't + successfully demangle it. */ + if (d_peek_char (&di) != '\0') + dc = NULL; + #ifdef CP_DEMANGLE_DEBUG if (dc == NULL) printf ("failed demangling\n"); @@ -3657,7 +3662,7 @@ is_ctor_or_dtor (mangled, ctor_kind, dtor_kind) dc = d_mangled_name (&di, 1); - if (dc == NULL) + if (dc == NULL || d_peek_char (&di) != '\0') return 0; while (dc != NULL) |