re PR c++/71696 (Libiberty Demangler segfaults (6))
authorMarcel Böhme <boehme.marcel@gmail.com>
Thu, 4 Aug 2016 16:53:18 +0000 (16:53 +0000)
committerJeff Law <law@gcc.gnu.org>
Thu, 4 Aug 2016 16:53:18 +0000 (10:53 -0600)
commit1841e25ca581e68d4a331135fc5bdee2da7b6514
treebd35487dce4bd0a9442cecd0fbd76b70a3e759cc
parentda84183c71bfd681545d046d1d81ab46fe96a818
re PR c++/71696 (Libiberty Demangler segfaults (6))

2016-08-04  Marcel Böhme  <boehme.marcel@gmail.com>

PR c++/71696
* cplus-dem.c: Prevent infinite recursion when there is a cycle
in the referencing of remembered mangled types.
(work_stuff): New stack to keep track of the remembered mangled
types that are currently being processed.
(push_processed_type): New method to push currently processed
remembered type onto the stack.
(pop_processed_type): New method to pop currently processed
remembered type from the stack.
(work_stuff_copy_to_from): Copy values of new variables.
(delete_non_B_K_work_stuff): Free stack memory.
(demangle_args): Push/Pop currently processed remembered type.
(do_type): Do not demangle a cyclic reference and push/pop
referenced remembered type.

From-SVN: r239143
libiberty/ChangeLog
libiberty/cplus-dem.c
libiberty/testsuite/demangle-expected