better check for version
authorJim Laskey <jlaskey@mac.com>
Thu, 30 Nov 2006 18:29:23 +0000 (18:29 +0000)
committerJim Laskey <jlaskey@mac.com>
Thu, 30 Nov 2006 18:29:23 +0000 (18:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32045 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineDebugInfo.cpp

index f6de1046fae6dddf528c2223aa99815a818a0745..48db413d5369259128aeb7f6ee6bfda00dfd88c7 100644 (file)
@@ -1390,11 +1390,23 @@ bool DIVerifier::Verify(GlobalVariable *GV) {
     return false;
   }
 
-  // Get the Tag
+  // Get the Tag.
   unsigned Tag = DebugInfoDesc::TagFromGlobal(GV);
   
   // Check for user defined descriptors.
-  if (Tag == DW_TAG_invalid) return true;
+  if (Tag == DW_TAG_invalid) {
+    ValiditySlot = Valid;
+    return true;
+  }
+  
+  // Get the Version.
+  unsigned Version = DebugInfoDesc::VersionFromGlobal(GV);
+  
+  // Check for version mismatch.
+  if (Version != LLVMDebugVersion) {
+    ValiditySlot = Invalid;
+    return false;
+  }
 
   // Construct an empty DebugInfoDesc.
   DebugInfoDesc *DD = DebugInfoDesc::DescFactory(Tag);