aboutsummaryrefslogtreecommitdiff
path: root/libiberty/cp-demangle.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@wasabisystems.com>2003-12-01 22:04:04 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2003-12-01 22:04:04 +0000
commitf26deb3d4478566f86a9aa21f54b08b457abe79c (patch)
treeb912fd4effe416a4fa963feda3f2d3e896417a19 /libiberty/cp-demangle.c
parentbe571b775855e3c25831e38b9933dd3ff96f63a6 (diff)
cp-demangle.c (d_demangle): Only return success if we consumed the entire demangled string.
* cp-demangle.c (d_demangle): Only return success if we consumed the entire demangled string. (is_ctor_or_dtor): Likewise. From-SVN: r74129
Diffstat (limited to 'libiberty/cp-demangle.c')
-rw-r--r--libiberty/cp-demangle.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index bd67958410b..0fe568faf0e 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)