Skip to content
Unverified Commit 4737959d authored by Craig Topper's avatar Craig Topper Committed by GitHub
Browse files

[AST] Use APIntStorage to fix memory leak in EnumConstantDecl. (#78311)

EnumConstantDecl is allocated by the ASTContext allocator so the
destructor is never called.

This patch takes a similar approach to IntegerLiteral by using
APIntStorage to allocate large APSInts using the ASTContext allocator as
well.

The downside is that an additional heap allocation and copy of the data
needs to be made when calling getInitValue if the APSInt is large.

Fixes #78160.
parent 337b7715
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment