Be a bit more tolerant of broken code
authorChris Lattner <sabre@nondot.org>
Mon, 17 Nov 2003 01:17:04 +0000 (01:17 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 17 Nov 2003 01:17:04 +0000 (01:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10050 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/AsmWriter.cpp

index f92fe25fd2528f0f2cbefc6d79c6f774eddee393..2c36ed98cb79dec81c2b5b050e42b5533087694e 100644 (file)
@@ -912,15 +912,15 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
       writeOperand(AI->getArraySize(), true);
     }
   } else if (isa<CastInst>(I)) {
-    writeOperand(Operand, true);
+    if (Operand) writeOperand(Operand, true);   // Work with broken code
     Out << " to ";
     printType(I.getType());
   } else if (isa<VAArgInst>(I)) {
-    writeOperand(Operand, true);
+    if (Operand) writeOperand(Operand, true);   // Work with broken code
     Out << ", ";
     printType(I.getType());
   } else if (const VANextInst *VAN = dyn_cast<VANextInst>(&I)) {
-    writeOperand(Operand, true);
+    if (Operand) writeOperand(Operand, true);   // Work with broken code
     Out << ", ";
     printType(VAN->getArgType());
   } else if (Operand) {   // Print the normal way...