[clang] [clang][AST][ASTMerge] prevent AST nodes from being deallocated early (PR #73096)

Balázs Kéri via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 23 02:46:21 PST 2023


balazske wrote:

You have found that reason for the crash is that references to `IdentifierInfo` are remaining in `OnDiskChainedHashTableGenerator` and previously deallocated by `ASTUnit` destruction? In this case why is the `ASTUnit` (or something in it, probably `ASTContext`) the owner of the data, and not `OnDiskChainedHashTableGenerator`?
By using `ASTImporter` it is possible that it moves data from the "old" AST to the "new" without copy (if yes this is a bug) and such a situation can cause memory errors.

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


More information about the cfe-commits mailing list