diff options
author | Mark Wielaard <mark@klomp.org> | 2017-03-08 14:28:38 +0000 |
---|---|---|
committer | Markus Trippelsdorf <trippels@gcc.gnu.org> | 2017-03-08 14:28:38 +0000 |
commit | a46586c34f32db516de3e5a2c61968015cfcd9d0 (patch) | |
tree | 1d24f195851c031e0d3f5a1d72300583d1befa25 /libiberty/cp-demint.c | |
parent | 121eb024c878d3b2474a3715d5250227af9613f7 (diff) | |
download | gcc-a46586c34f32db516de3e5a2c61968015cfcd9d0.zip gcc-a46586c34f32db516de3e5a2c61968015cfcd9d0.tar.gz gcc-a46586c34f32db516de3e5a2c61968015cfcd9d0.tar.bz2 |
Fix PR demangler/70909 and 67264 (endless demangler recursion)
ChangeLog:
PR demangler/70909
PR demangler/67264
* include/demangle.h: Add d_printing to struct demangle_component
and pass struct demangle_component as non const.
libiberty/ChangeLog:
PR demangler/70909
PR demangler/67264
* cp-demangle.c: Fix endless recursion. Pass
struct demangle_component as non const.
(d_make_empty): Initialize variable.
(d_print_comp_inner): Limit recursion.
(d_print_comp): Decrement variable.
* cp-demint.c (cplus_demangle_fill_component): Initialize
variable.
(cplus_demangle_fill_builtin_type): Likewise.
(cplus_demangle_fill_operator): Likewise.
* testsuite/demangle-expected: Add tests.
From-SVN: r245978
Diffstat (limited to 'libiberty/cp-demint.c')
-rw-r--r-- | libiberty/cp-demint.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libiberty/cp-demint.c b/libiberty/cp-demint.c index 64baffa..13a71d9 100644 --- a/libiberty/cp-demint.c +++ b/libiberty/cp-demint.c @@ -123,6 +123,7 @@ cplus_demangle_fill_component (struct demangle_component *p, p->type = type; p->u.s_binary.left = left; p->u.s_binary.right = right; + p->d_printing = 0; return 1; } @@ -146,6 +147,7 @@ cplus_demangle_fill_builtin_type (struct demangle_component *p, { p->type = DEMANGLE_COMPONENT_BUILTIN_TYPE; p->u.s_builtin.type = &cplus_demangle_builtin_types[i]; + p->d_printing = 0; return 1; } } @@ -172,6 +174,7 @@ cplus_demangle_fill_operator (struct demangle_component *p, { p->type = DEMANGLE_COMPONENT_OPERATOR; p->u.s_operator.op = &cplus_demangle_operators[i]; + p->d_printing = 0; return 1; } } |