summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-09-27 16:10:30 +0000
committerDan Gohman <gohman@apple.com>2009-09-27 16:10:30 +0000
commit0e70af36c0548370cca4e62e7c4450dcefe9c7ef (patch)
treebece555ffdc94ac533a5835a081a71ff8492732a /llvm/lib
parente28bd65aedab3539deb5ac7ff9d9bfe6cd200268 (diff)
downloadbcm5719-llvm-0e70af36c0548370cca4e62e7c4450dcefe9c7ef.tar.gz
bcm5719-llvm-0e70af36c0548370cca4e62e7c4450dcefe9c7ef.zip
Grab an LLVM Context from an instruction that exists rather than one
that is deleted in some situations. This fixes a use-after-free. llvm-svn: 82903
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/LICM.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index fe37ab4caa1..6df246fa80e 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/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);
}
}
}
OpenPOWER on IntegriCloud