Fix the previous bug the correct way. This fixes ptrdist/bc
authorChris Lattner <sabre@nondot.org>
Sun, 24 Oct 2004 04:27:59 +0000 (04:27 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 24 Oct 2004 04:27:59 +0000 (04:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17201 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bytecode/Writer/SlotCalculator.cpp

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