[all-commits] [llvm/llvm-project] baef6f: [Clang] Increase the default expression nesting li...

cor3ntin via All-commits all-commits at lists.llvm.org
Wed Mar 19 07:17:00 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: baef6fadbf0e4ddac33c6a8a6275208435f52965
      https://github.com/llvm/llvm-project/commit/baef6fadbf0e4ddac33c6a8a6275208435f52965
  Author: cor3ntin <corentinjabot at gmail.com>
  Date:   2025-03-19 (Wed, 19 Mar 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Driver/Options.td
    M clang/include/clang/Parse/Parser.h
    M clang/include/clang/Sema/ParsedAttr.h
    M clang/lib/Parse/ParseDecl.cpp
    M clang/lib/Parse/ParseStmt.cpp
    M clang/lib/Parse/ParseTemplate.cpp
    M clang/lib/Parse/Parser.cpp
    M clang/lib/Sema/ParsedAttr.cpp
    M clang/test/Parser/parser_overflow.c

  Log Message:
  -----------
  [Clang] Increase the default expression nesting limit (#132021)

This iterates on #104717 (which we had to revert)

In a bid to increase our chances of success, we try to avoid blowing up
the stack by

-  Using `runWithSufficientStackSpace` in ParseCompoundStatement
-  Reducing the size of `StmtVector` a bit
-  Reducing the size of `DeclsInGroup` a bit
- Removing a few `ParsedAttributes` from the stacks in places where they
are not strictly necessary. `ParsedAttributes` is a _huge_ object

On a 64 bits system, the following stack size reductions are observed

```
ParseStatementOrDeclarationAfterAttributes:  344 -> 264
ParseStatementOrDeclaration: 520 -> 376
ParseCompoundStatementBody: 1080 -> 1016
ParseDeclaration: 264 -> 120
```

Fixes #94728



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list