Add an assert to cature null Operands. It is better to catch it here than
authorReid Spencer <rspencer@reidspencer.com>
Sun, 29 Aug 2004 19:37:59 +0000 (19:37 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sun, 29 Aug 2004 19:37:59 +0000 (19:37 +0000)
to SIGSEGV in the bowels of isa<...> later.

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

lib/VMCore/AsmWriter.cpp

index b109cb006eb6cfc9453b4d251a42514d9b0a3a10..f70a82839aa1e0e4c60affc976687e0514e5db1f 100644 (file)
@@ -744,6 +744,7 @@ std::ostream &AssemblyWriter::printTypeAtLeastOneLevel(const Type *Ty) {
 
 void AssemblyWriter::writeOperand(const Value *Operand, bool PrintType, 
                                   bool PrintName) {
+  assert(Operand != 0 && "Illegal Operand");
   if (PrintType) { Out << ' '; printType(Operand->getType()); }
   WriteAsOperandInternal(Out, Operand, PrintName, TypeNames, &Machine);
 }