aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/ELFObjectWriter.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2024-07-08 09:26:44 -0700
committerGitHub <noreply@github.com>2024-07-08 09:26:44 -0700
commit0387a86f9a6d5bb0f178804784296e37fb34ca03 (patch)
tree8e43efd910ad344e8ebc96149652f079d00c025a /llvm/lib/MC/ELFObjectWriter.cpp
parent840e5075447fd2e7ae1f23c112e959b504d8ff42 (diff)
downloadllvm-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