Fix a bug that Brian brought to my attention. This corrects:
authorChris Lattner <sabre@nondot.org>
Sat, 23 Oct 2004 03:10:23 +0000 (03:10 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 23 Oct 2004 03:10:23 +0000 (03:10 +0000)
Assembler/2004-10-22-BCWriterUndefBug.llx

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17177 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bytecode/Writer/SlotCalculator.cpp

index d4145dbcdcab7ada090108edaefd2948b1274fce..0f298dcd0032900fb86029cb6957449356969a20 100644 (file)
@@ -150,7 +150,8 @@ void SlotCalculator::processModule() {
         TypePlane &Plane = Table[plane];
         unsigned FirstNonStringID = 0;
         for (unsigned i = 0, e = Plane.size(); i != e; ++i)
-          if (isa<ConstantAggregateZero>(Plane[i]) ||
+          if (isa<ConstantAggregateZero>(Plane[i]) || 
+             isa<UndefValue>(Plane[i]) ||
               cast<ConstantArray>(Plane[i])->isString()) {
             // Check to see if we have to shuffle this string around.  If not,
             // don't do anything.