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
This commit is contained in:
Dan Gohman 2009-09-27 16:10:30 +00:00
parent 3479d18b98
commit f37cfed791

View File

@ -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);
}
}
}