Don't crash if an MBB doesn't have an LLVM BB
authorChris Lattner <sabre@nondot.org>
Thu, 5 Oct 2006 21:40:14 +0000 (21:40 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 5 Oct 2006 21:40:14 +0000 (21:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30757 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter.cpp

index 5311b2c5cbb93b3737f3bd052995d5106d3a6871..96a481fc8461577cebb9f3d5bf9367ae64b3070b 100644 (file)
@@ -857,7 +857,7 @@ void AsmPrinter::printBasicBlockLabel(const MachineBasicBlock *MBB,
     << MBB->getNumber();
   if (printColon)
     O << ':';
-  if (printComment)
+  if (printComment && MBB->getBasicBlock())
     O << '\t' << TAI->getCommentString() << MBB->getBasicBlock()->getName();
 }