From: Dan Gohman Date: Fri, 31 Jul 2009 18:23:24 +0000 (+0000) Subject: Fix printing of Alloca instructions with null operands. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=69bff07b4dc95fd0cc9d7580977beb08259daa17;p=oota-llvm.git Fix printing of Alloca instructions with null operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77697 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 8824fd9244f..8358c5d84c4 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -1915,7 +1915,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) { } else if (const AllocationInst *AI = dyn_cast(&I)) { Out << ' '; TypePrinter.print(AI->getType()->getElementType(), Out); - if (AI->isArrayAllocation()) { + if (!AI->getArraySize() || AI->isArrayAllocation()) { Out << ", "; writeOperand(AI->getArraySize(), true); }