Fix bug in previous checkin

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9656 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-11-02 06:54:48 +00:00
parent 766be1de9d
commit fc07a3473a

View File

@ -1543,7 +1543,7 @@ Instruction *InstCombiner::visitCastInst(CastInst &CI) {
// size, rewrite the allocation instruction to allocate the "right" type.
//
if (AllocationInst *AI = dyn_cast<AllocationInst>(Src))
if (AI->hasOneUse())
if (AI->hasOneUse() && !AI->isArrayAllocation())
if (const PointerType *PTy = dyn_cast<PointerType>(CI.getType())) {
// Get the type really allocated and the type casted to...
const Type *AllocElTy = AI->getAllocatedType();