Demangler integer overflow fixes from Marcel Böhme.
authorMarcel Böhme <boehme.marcel@gmail.com>
Mon, 2 May 2016 17:06:40 +0000 (17:06 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Mon, 2 May 2016 17:06:40 +0000 (17:06 +0000)
commitbfbc839a0ba7d31399728c5b73e9a1cd6cefc9ae
tree1b8741b43eaf24ec813b24240428e1f12d730a11
parent818b88a7a1be36183bc4bbc24535329389d6178e
Demangler integer overflow fixes from Marcel Böhme.

PR c++/70498
* cp-demangle.c: Parse numbers as integer instead of long to avoid
overflow after sanity checks. Include <limits.h> if available.
(INT_MAX): Define if necessary.
(d_make_template_param): Takes integer argument instead of long.
(d_make_function_param): Likewise.
(d_append_num): Likewise.
(d_identifier): Likewise.
(d_number): Parse as and return integer.
(d_compact_number): Handle overflow.
(d_source_name): Change variable type to integer for parsed number.
(d_java_resource): Likewise.
(d_special_name): Likewise.
(d_discriminator): Likewise.
(d_unnamed_type): Likewise.
* testsuite/demangle-expected: Add regression test cases.

From-SVN: r235767
libiberty/ChangeLog
libiberty/cp-demangle.c
libiberty/testsuite/demangle-expected