diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-11-30 18:29:23 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-11-30 18:29:23 +0000 |
commit | 2bbff6d17350edae5d9ae48b3f0735386d69cccf (patch) | |
tree | 558534f5952aecafe5b0309836b4f2d7714def98 /lib/CodeGen/MachineDebugInfo.cpp | |
parent | d0a6a7a0307f124d47df9c649946bcb0767c5631 (diff) |
better check for version
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32045 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/MachineDebugInfo.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/CodeGen/MachineDebugInfo.cpp b/lib/CodeGen/MachineDebugInfo.cpp index f6de1046fa..48db413d53 100644 --- a/lib/CodeGen/MachineDebugInfo.cpp +++ b/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); |