aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorJordan Rupprecht <rupprecht@google.com>2022-09-14 06:52:47 -0700
committerJordan Rupprecht <rupprecht@google.com>2022-09-14 06:52:47 -0700
commit1f3def30ca86a35a173cb1fe10e3e73d2a0d0f6f (patch)
tree5f8c7e589501ffae3d788a519728e88d0a5ffb92 /clang/lib/Frontend/CompilerInvocation.cpp
parentd1dec04d767a23e5a4134d79aad0396ce9c5d985 (diff)
downloadllvm-1f3def30ca86a35a173cb1fe10e3e73d2a0d0f6f.zip
llvm-1f3def30ca86a35a173cb1fe10e3e73d2a0d0f6f.tar.gz
llvm-1f3def30ca86a35a173cb1fe10e3e73d2a0d0f6f.tar.bz2
Fix heap-use-after-free when clearing DIEs in fission compile units.
D131437 caused heap-use-after-free failures when testing TestCreateAfterAttach.py in asan mode, and "regular" crashes outside of asan. This appears to be due to a mismatch in a couple places where we choose to clear the DIEs. When we clear the DIE of a skeleton unit, we unconditionally clear the DIE of the DWO unit if it exists. However, `~ScopedExtractDIEs()` only looks at the skeleton unit when deciding to clear. If we decide to clear the skeleton unit because it is now unused, we end up clearing the DWO unit that _is_ used. This change adds a guard by checking `m_cancel_scopes` to prevent clearing the DWO unit. This is 100% reproducible by running TestCreateAfterAttach.py in asan mode, although it only seems to reproduce in our internal build, so no test case is added here. If someone has suggestions on how to write one, I can add it. Reviewed By: labath Differential Revision: https://reviews.llvm.org/D133790
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions