diff options
author | Reid Kleckner <rnk@google.com> | 2021-03-04 13:52:30 -0800 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2021-03-04 13:57:46 -0800 |
commit | 1c2e7d200df27e91631ba300965245518bfe252c (patch) | |
tree | 348e45175809c1a962955ad326a5a28e141f0e52 /clang/lib/CodeGen/CGCall.cpp | |
parent | 9899427174b4a6a42c64dcdf29e3f23e40a1fc19 (diff) | |
download | llvm-1c2e7d200df27e91631ba300965245518bfe252c.zip llvm-1c2e7d200df27e91631ba300965245518bfe252c.tar.gz llvm-1c2e7d200df27e91631ba300965245518bfe252c.tar.bz2 |
[MS] Fix crash involving gnu stmt exprs and inalloca
Use a WeakTrackingVH to cope with the stmt emission logic that cleans up
unreachable blocks. This invalidates the reference to the deferred
replacement placeholder. Cope with it.
Fixes PR25102 (from 2015!)
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index f5411da..edcaa52 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -4436,7 +4436,8 @@ llvm::CallBase *CodeGenFunction::EmitCallOrInvoke(llvm::FunctionCallee Callee, void CodeGenFunction::deferPlaceholderReplacement(llvm::Instruction *Old, llvm::Value *New) { - DeferredReplacements.push_back(std::make_pair(Old, New)); + DeferredReplacements.push_back( + std::make_pair(llvm::WeakTrackingVH(Old), New)); } namespace { |