[clang] [clang] Prevent stack overflow on deeply nested template arguments (PR #224393)

Daniel Petrovic via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 20 05:46:22 PDT 2026


daniel-petrovic wrote:

> I'm reluctant to accept the patch as-is, though the latest approach makes sense.
> 
> I want to question if people would write such paranoid recursive template arguments in real world codebase - the issue was fuzzer generated.
> 
> I'm not saying this is not a bug, I wonder if doing so would also require us to revisit every recursive calls and add guards here and there?

Thanks for the feedback. 

IMO Parser should be robust against all syntactically valid inputs, including those from code generators or fuzzers. Currently this specific path lacks the standard stack guard used elsewhere.

Regarding your concern about scope:  I don't believe fixing one guard that caused this specific issue implies auditing every other recursive call.

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


More information about the cfe-commits mailing list