Ignore malformed global variable debug info.
authorDevang Patel <dpatel@apple.com>
Fri, 4 Sep 2009 23:59:07 +0000 (23:59 +0000)
committerDevang Patel <dpatel@apple.com>
Fri, 4 Sep 2009 23:59:07 +0000 (23:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81055 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index 0e55b545833b04fcca85e7267fbba7e9eec8a520..bc4333d9c1bb032e71e1c99cc75a5aef3945227f 100644 (file)
@@ -1482,6 +1482,10 @@ void DwarfDebug::ConstructCompileUnit(MDNode *N) {
 
 void DwarfDebug::ConstructGlobalVariableDIE(MDNode *N) {
   DIGlobalVariable DI_GV(N);
+  
+  // If debug information is malformed then ignore it.
+  if (DI_GV.Verify() == false)
+    return;
 
   // Check for pre-existence.
   DIE *&Slot = ModuleCU->getDieMapSlotFor(DI_GV.getNode());