diff options
author | Chris Lattner <sabre@nondot.org> | 2004-11-09 05:10:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-11-09 05:10:56 +0000 |
commit | 52f20f83082ec92d536f2dcc4234f35638aea6f9 (patch) | |
tree | 3fee634de385e2d49c70f6b8586e7681cdbe199e /lib/Transforms/IPO/RaiseAllocations.cpp | |
parent | 2fc09aec718177b7a97ee0382fb58b5035a38cf0 (diff) | |
download | llvm-52f20f83082ec92d536f2dcc4234f35638aea6f9.tar.gz llvm-52f20f83082ec92d536f2dcc4234f35638aea6f9.tar.bz2 llvm-52f20f83082ec92d536f2dcc4234f35638aea6f9.tar.xz |
Fix bug: 2004-11-08-FreeUseCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17642 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/RaiseAllocations.cpp')
-rw-r--r-- | lib/Transforms/IPO/RaiseAllocations.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/RaiseAllocations.cpp b/lib/Transforms/IPO/RaiseAllocations.cpp index d91d23fd18..4d5650f90a 100644 --- a/lib/Transforms/IPO/RaiseAllocations.cpp +++ b/lib/Transforms/IPO/RaiseAllocations.cpp @@ -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; } |