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/CodeGenFunction.h | |
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/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 8ef0de0..2ce87ac 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -4539,8 +4539,8 @@ private: void deferPlaceholderReplacement(llvm::Instruction *Old, llvm::Value *New); - llvm::SmallVector<std::pair<llvm::Instruction *, llvm::Value *>, 4> - DeferredReplacements; + llvm::SmallVector<std::pair<llvm::WeakTrackingVH, llvm::Value *>, 4> + DeferredReplacements; /// Set the address of a local variable. void setAddrOfLocalVar(const VarDecl *VD, Address Addr) { |