diff options
author | Dan Gohman <gohman@apple.com> | 2009-09-27 16:10:30 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-09-27 16:10:30 +0000 |
commit | f37cfed7911971e0326ed0b2de526bcc26c92950 (patch) | |
tree | 597dd061a94691997ef80ad5d7f2ad09313198e2 /lib | |
parent | 3479d18b98694d9db6c2897ea909e6e381abfe92 (diff) | |
download | external_llvm-f37cfed7911971e0326ed0b2de526bcc26c92950.zip external_llvm-f37cfed7911971e0326ed0b2de526bcc26c92950.tar.gz external_llvm-f37cfed7911971e0326ed0b2de526bcc26c92950.tar.bz2 |
Grab an LLVM Context from an instruction that exists rather than one
that is deleted in some situations. This fixes a use-after-free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82903 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Scalar/LICM.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index fe37ab4..6df246f 100644 --- a/lib/Transforms/Scalar/LICM.cpp +++ b/lib/Transforms/Scalar/LICM.cpp @@ -593,7 +593,7 @@ void LICM::sink(Instruction &I) { if (AI) { std::vector<AllocaInst*> Allocas; Allocas.push_back(AI); - PromoteMemToReg(Allocas, *DT, *DF, I.getContext(), CurAST); + PromoteMemToReg(Allocas, *DT, *DF, AI->getContext(), CurAST); } } } |