[clang] [Serialization] Check for stack exhaustion when reading declarations (PR #79875)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 30 02:46:41 PST 2024


ilya-biryukov wrote:

> Could you show the stack (omitting/annotating the repeated part) that leads to failure? and/or the AST shape that leads to failure?

See the test I added. All you need is ~10k overloads of a method in a class and a `using Base::func` in the derived class.\
The AST represents that as a linked list inside `UsingShadowDecl` (each shadow decl references the next one). Serializing them works fine, but deserialization is recursive and blows up.

Feel free to just call `-ast-dump` on the test I posted (it only crashes when reading the pcm, so outputing AST should be fine)

https://github.com/llvm/llvm-project/pull/79875


More information about the cfe-commits mailing list