Fix bug: 2004-11-08-FreeUseCrash.ll

llvm-svn: 17642
This commit is contained in:
Chris Lattner 2004-11-09 05:10:56 +00:00
parent 1276fbe8ba
commit 1f0a97c6cb
1 changed files with 3 additions and 1 deletions

View File

@ -201,7 +201,9 @@ bool RaiseAllocations::runOnModule(Module &M) {
new BranchInst(II->getNormalDest(), I);
// Delete the old call site
I->getParent()->getInstList().erase(I);
if (I->getType() != Type::VoidTy)
I->replaceAllUsesWith(UndefValue::get(I->getType()));
I->eraseFromParent();
Changed = true;
++NumRaised;
}