[clang] [clang] Increase the default expression nesting limit (PR #104717)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 20 10:32:21 PDT 2024


AaronBallman wrote:

> ```
> $ ./build/bin/clang -fsyntax-only -DHUGE 2>&1 clang/test/Parser/parser_overflow.c -fbracket-depth=2048
> Segmentation fault
> 
> $ ./build/bin/clang -fsyntax-only -DHUGE 2>&1 clang/test/Parser/parser_overflow.c -fbracket-depth=2045
> clang/test/Parser/parser_overflow.c:11:2049: fatal error: bracket nesting level exceeded maximum of 2045
> Segmentation fault
> 
> $ ./build/bin/clang -fsyntax-only -DHUGE 2>&1 clang/test/Parser/parser_overflow.c -fbracket-depth=2040
> clang/test/Parser/parser_overflow.c:11:2044: fatal error: bracket nesting level exceeded maximum of 2040
> clang/test/Parser/parser_overflow.c:11:2044: note: use -fbracket-depth=N to increase maximum nesting level
> 1 error generated.
> ```
> 
> Any number under 2040 is fine on my debug build. Between 2040 and 2050, seems random.

lol, so we were very close with 2048. :-D Thank you!

> @AaronBallman should we back to the 1024 option?

I'm hoping we can find a way to reduce the stack usage rather than change the option, but 1024 is a good fallback 

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


More information about the cfe-commits mailing list