aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 92b7f1a39b..18de1269e9 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -2035,7 +2035,7 @@ Instruction *InstCombiner::visitCastInst(CastInst &CI) {
New = new MallocInst(CastElTy, Amt, Name);
else
New = new AllocaInst(CastElTy, Amt, Name);
- InsertNewInstBefore(New, CI);
+ InsertNewInstBefore(New, *AI);
return ReplaceInstUsesWith(CI, New);
}
}