aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/LowerAllocations.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Utils/LowerAllocations.cpp')
-rw-r--r--lib/Transforms/Utils/LowerAllocations.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp
index 041d89fab1..0d26e2a233 100644
--- a/lib/Transforms/Utils/LowerAllocations.cpp
+++ b/lib/Transforms/Utils/LowerAllocations.cpp
@@ -165,8 +165,7 @@ bool RaiseAllocations::runOnBasicBlock(BasicBlock *BB) {
MallocInst *MallocI = new MallocInst(PtrSByte, CI->getOperand(1),
CI->getName());
CI->setName("");
- BI = BIL.insert(BI, MallocI)+1;
- ReplaceInstWithInst(BIL, BI, new CastInst(MallocI, PtrSByte));
+ ReplaceInstWithInst(BIL, BI, MallocI);
Changed = true;
continue; // Skip the ++BI
} else if (CI->getCalledValue() == FreeMeth) { // Replace call to free?