diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2024-07-08 09:26:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-08 09:26:44 -0700 |
commit | 0387a86f9a6d5bb0f178804784296e37fb34ca03 (patch) | |
tree | 8e43efd910ad344e8ebc96149652f079d00c025a /llvm/lib/MC/ELFObjectWriter.cpp | |
parent | 840e5075447fd2e7ae1f23c112e959b504d8ff42 (diff) | |
download | llvm-0387a86f9a6d5bb0f178804784296e37fb34ca03.zip llvm-0387a86f9a6d5bb0f178804784296e37fb34ca03.tar.gz llvm-0387a86f9a6d5bb0f178804784296e37fb34ca03.tar.bz2 |
[clang][modules] Fix use-after-free in header serialization (#96356)
With the pruning of unused module map files disabled
(`-fno-modules-prune-non-affecting-module-map-files`), `HeaderFileInfo`
no longer gets deserialized before `ASTWriter::WriteHeaderSearch()`.
This function then interleaves the stores of references to `KnownHeader`
with their lazy deserialization. Lazy deserialization may cause
reallocation of `ModuleMap::Headers` entries (including its
`SmallVector<KnownHeader, 1>` values) thus making previously-stored
`ArrayRef<KnownHeader>` dangling. This patch fixes that situation by
storing a copy instead.
Diffstat (limited to 'llvm/lib/MC/ELFObjectWriter.cpp')
0 files changed, 0 insertions, 0 deletions