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

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 22 23:47:47 PST 2023


ChuanqiXu9 wrote:

> Debug the https://github.com/llvm/llvm-project/issues/72783 can prove it. Address interval (local from 0x3a9a00 to 0x3aaa00) allocated by allocator contains a IdentifierInfo variable (local address:0x3aa190) whose address is freed early.

In this case, it looks better to extract the use-after-free variable only instead of extracting the whole ASTUnit.

> As system header like stdio.h or math.h can't be put into test, it's hard to add testcase. Could anyone give me some guidance? Thanks in advance!

Generally, we need to reduce them in this case. e.g., we need to preprocess them, and remove unncessary parts until we can't. It is time consuming but it is worthy.

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


More information about the cfe-commits mailing list