Fix PR demangler/70909 and 67264 (endless demangler recursion)
authorMark Wielaard <mark@klomp.org>
Wed, 8 Mar 2017 14:28:38 +0000 (14:28 +0000)
committerMarkus Trippelsdorf <trippels@gcc.gnu.org>
Wed, 8 Mar 2017 14:28:38 +0000 (14:28 +0000)
commita46586c34f32db516de3e5a2c61968015cfcd9d0
tree1d24f195851c031e0d3f5a1d72300583d1befa25
parent121eb024c878d3b2474a3715d5250227af9613f7
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
ChangeLog
include/demangle.h
libiberty/ChangeLog
libiberty/cp-demangle.c
libiberty/cp-demint.c
libiberty/testsuite/demangle-expected