diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/MachineDebugInfo.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineDebugInfo.cpp b/llvm/lib/CodeGen/MachineDebugInfo.cpp index f6de1046fae..48db413d536 100644 --- a/llvm/lib/CodeGen/MachineDebugInfo.cpp +++ b/llvm/lib/CodeGen/MachineDebugInfo.cpp @@ -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); |

