Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.503 -> 1.504
---
Log message:

Fix PR905: http://llvm.org/PR905  and InstCombine/2006-09-11-EmptyStructCrash.ll



---
Diffs of the changes:  (+2 -1)

 InstructionCombining.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.503 
llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.504
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.503   Sat Sep  9 
17:02:56 2006
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Mon Sep 11 16:43:16 2006
@@ -5187,7 +5187,8 @@
       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;
       }



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to