summaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-01 22:04:04 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-01 22:04:04 +0000
commit72983aaaa3107d9c4d65eb1e00da7021ecc0a8c2 (patch)
treeb912fd4effe416a4fa963feda3f2d3e896417a19 /libiberty
parent826cdd77a68e78c32eb5fe8e02a376a535ebdc25 (diff)
downloadgcc-72983aaaa3107d9c4d65eb1e00da7021ecc0a8c2.tar.gz
* cp-demangle.c (d_demangle): Only return success if we consumed
the entire demangled string. (is_ctor_or_dtor): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74129 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog10
-rw-r--r--libiberty/cp-demangle.c9
2 files changed, 17 insertions, 2 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 2f5f7b52973..a6cfd9e0209 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,13 @@
+2003-11-29 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * cp-demangle.c (d_demangle): Only return success if we consumed
+ the entire demangled string.
+ (is_ctor_or_dtor): Likewise.
+
+ * testsuite/demangle-expected: Revert one part of 2003-06-26 patch
+ to restore expected result of EDG test case to original expected
+ result.
+
2003-11-26 Ian Lance Taylor <ian@wasabisystems.com>
* cp-demangle.c (struct d_print_mod): Add templates field.
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)