From d4d987dd4a0bb0302804876db40ef418a9b19f49 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 2 Nov 2003 06:54:48 +0000 Subject: Fix bug in previous checkin llvm-svn: 9656 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp') diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index d5da0b3b54a..bbdfda3f76b 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -1543,7 +1543,7 @@ Instruction *InstCombiner::visitCastInst(CastInst &CI) { // size, rewrite the allocation instruction to allocate the "right" type. // if (AllocationInst *AI = dyn_cast(Src)) - if (AI->hasOneUse()) + if (AI->hasOneUse() && !AI->isArrayAllocation()) if (const PointerType *PTy = dyn_cast(CI.getType())) { // Get the type really allocated and the type casted to... const Type *AllocElTy = AI->getAllocatedType(); -- cgit v1.2.3