This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71696] Libiberty Demangler segfaults (6)
- From: "law at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 04 Aug 2016 16:53:50 +0000
- Subject: [Bug c++/71696] Libiberty Demangler segfaults (6)
- Auto-submitted: auto-generated
- References: <bug-71696-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71696
--- Comment #2 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Author: law
Date: Thu Aug 4 16:53:18 2016
New Revision: 239143
URL: https://gcc.gnu.org/viewcvs?rev=239143&root=gcc&view=rev
Log:
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.
Modified:
trunk/libiberty/ChangeLog
trunk/libiberty/cplus-dem.c
trunk/libiberty/testsuite/demangle-expected