[Bug c++/70909] Libiberty Demangler segfaults (4)
mark at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Dec 2 16:01:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70909
--- Comment #22 from Mark Wielaard <mark at gcc dot gnu.org> ---
Created attachment 40230
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40230&action=edit
d_printing mark/walk/unmark protection
(In reply to Nathan Sidwell from comment #21)
> Why doesn't a mark/walk/unmark idiom when walking a potentially circular
> data structure work here? I.e. add a mutable counter to demangle_component.
> Inc/dec at start/end of d_print_comp? IIUC if it gets to >1 there's a
> problem.
That is a good idea. However it seems things aren't as simple as that.
The attached patch implements it, but that produces various testsuite failures:
./test-demangle: 960 tests, 7 failures
It might of course be that I messed up the check or that any of these failures
really are bad.
More information about the Gcc-bugs
mailing list