[clang] [clang][modules] Fix use-after-free in header serialization (PR #96356)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 28 08:04:27 PDT 2024


jansvoboda11 wrote:

> My main concern with this approach is I'm not sure that after fixing the memory issue we don't have a remaining logic bug. Because we are still modifying `ModuleMap::Headers` during `ASTWriter::WriteHeaderSearch` iteration and that looks suspicious. Need to think how to make sure the discovered unexpected modification isn't causing other problems.

How do you suggest we verify this? I don't see Clang storing reference to the `KnownHeader` vector anywhere else.

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


More information about the cfe-commits mailing list