Import patch from mainline GCC to fix an infinite recusion in the Rust demangler.
authorNick Clifton <nickc@redhat.com>
Mon, 31 Jan 2022 14:36:31 +0000 (14:36 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 31 Jan 2022 14:36:31 +0000 (14:36 +0000)
commitf10f8617a302f45dae721eae0cd659911f03d864
treecd6444637702f0c5d88e39fb8163fa3b07ad879e
parent9ff8aa7d418bc508dbd429576b93e30ed9dc5891
Import patch from mainline GCC to fix an infinite recusion in the Rust demangler.

PR 98886
PR 99935
* rust-demangle.c (struct rust_demangler): Add a recursion
counter.
(demangle_path): Increment/decrement the recursion counter upon
entry and exit.  Fail if the counter exceeds a fixed limit.
(demangle_type): Likewise.
(rust_demangle_callback): Initialise the recursion counter,
disabling if requested by the option flags.
libiberty/ChangeLog
libiberty/rust-demangle.c