summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 0e6c1b1f2dd..6961806bcb7 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -5187,7 +5187,8 @@ Instruction *InstCombiner::visitCastInst(CastInst &CI) {
Constant *ZeroUInt = Constant::getNullValue(Type::UIntTy);
unsigned NumZeros = 0;
while (SrcTy != DstTy &&
- isa<CompositeType>(SrcTy) && !isa<PointerType>(SrcTy)) {
+ isa<CompositeType>(SrcTy) && !isa<PointerType>(SrcTy) &&
+ SrcTy->getNumContainedTypes() /* not "{}" */) {
SrcTy = cast<CompositeType>(SrcTy)->getTypeAtIndex(ZeroUInt);
++NumZeros;
}
OpenPOWER on IntegriCloud