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); }