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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17642 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-11-09 05:10:56 +00:00
parent 2fc09aec71
commit 52f20f8308

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