summaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-15 23:18:49 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-15 23:18:49 +0000
commit08d5ae10da2b46cb60d0307b1aab3aec3806ed0c (patch)
tree6b3ec8e6d3b4c40586ea5513a47780f8a71880db /libiberty
parent12136637b11206e679525975ec88084fbbaa6775 (diff)
downloadgcc-08d5ae10da2b46cb60d0307b1aab3aec3806ed0c.tar.gz
* cp-demangle.c (d_demangle): If DMGL_PARAMS is not set, don't
expect that we've read the entire string. (is_ctor_or_dtor): Don't expect that we've read the entire string--reverse patch of 2003-11-29. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74651 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog7
-rw-r--r--libiberty/cp-demangle.c64
2 files changed, 40 insertions, 31 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index cd7200d0404..c33e83b3ef8 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,10 @@
+2003-12-15 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * cp-demangle.c (d_demangle): If DMGL_PARAMS is not set, don't
+ expect that we've read the entire string.
+ (is_ctor_or_dtor): Don't expect that we've read the entire
+ string--reverse patch of 2003-11-29.
+
2003-12-15 Brendan Kehoe <brendan@zen.org>
* libiberty/Makefile.in (floatformat.o): Add dependency on
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index e675752bbaa..7a806dc44b2 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -3622,9 +3622,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')
+ /* If DMGL_PARAMS is set, then if we didn't consume the entire
+ mangled string, then we didn't successfully demangle it. If
+ DMGL_PARAMS is not set, we didn't look at the trailing
+ parameters. */
+ if (((options & DMGL_PARAMS) != 0) && d_peek_char (&di) != '\0')
dc = NULL;
#ifdef CP_DEMANGLE_DEBUG
@@ -3829,37 +3831,37 @@ is_ctor_or_dtor (mangled, ctor_kind, dtor_kind)
dc = d_mangled_name (&di, 1);
+ /* Note that because we did not pass DMGL_PARAMS, we don't expect to
+ demangle the entire string. */
+
ret = 0;
- if (d_peek_char (&di) == '\0')
+ while (dc != NULL)
{
- while (dc != NULL)
+ switch (dc->type)
{
- switch (dc->type)
- {
- default:
- dc = NULL;
- break;
- case D_COMP_TYPED_NAME:
- case D_COMP_TEMPLATE:
- case D_COMP_RESTRICT_THIS:
- case D_COMP_VOLATILE_THIS:
- case D_COMP_CONST_THIS:
- dc = d_left (dc);
- break;
- case D_COMP_QUAL_NAME:
- dc = d_right (dc);
- break;
- case D_COMP_CTOR:
- *ctor_kind = dc->u.s_ctor.kind;
- ret = 1;
- dc = NULL;
- break;
- case D_COMP_DTOR:
- *dtor_kind = dc->u.s_dtor.kind;
- ret = 1;
- dc = NULL;
- break;
- }
+ default:
+ dc = NULL;
+ break;
+ case D_COMP_TYPED_NAME:
+ case D_COMP_TEMPLATE:
+ case D_COMP_RESTRICT_THIS:
+ case D_COMP_VOLATILE_THIS:
+ case D_COMP_CONST_THIS:
+ dc = d_left (dc);
+ break;
+ case D_COMP_QUAL_NAME:
+ dc = d_right (dc);
+ break;
+ case D_COMP_CTOR:
+ *ctor_kind = dc->u.s_ctor.kind;
+ ret = 1;
+ dc = NULL;
+ break;
+ case D_COMP_DTOR:
+ *dtor_kind = dc->u.s_dtor.kind;
+ ret = 1;
+ dc = NULL;
+ break;
}
}