[Bug demangler/80513] demangler walks past trailing nul in mangled name in a bunch of cases
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Apr 26 18:12:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80513
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Richard Smith from comment #1)
> While we're here, this check for overflow in consume_count is nonsense, and
> any decent optimising compiler is going to optimise away the overflow check:
>
> https://github.com/gcc-mirror/gcc/blob/master/libiberty/cplus-dem.c#L525
>
> Testcase:
>
> $ echo '_Z4294967297x' | c++filt
> x
>
> Oops.
That overflow happens in d_number in cp-demangle.c, so that check isn't used
for your testcase. So we need to add a (not nonsense) check for overflow in
d_number, and fix the one in consume_count.
More information about the Gcc-bugs
mailing list