[llvm] a8bc9c3 - Use new DWARFDataExtractor::getInitialLength in DWARFVerifier

Pavel Labath via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 04:12:18 PST 2020


Author: Pavel Labath
Date: 2020-03-04T13:01:34+01:00
New Revision: a8bc9c3f0fe68e61790931e3de28f24f73d4fd37

URL: https://github.com/llvm/llvm-project/commit/a8bc9c3f0fe68e61790931e3de28f24f73d4fd37
DIFF: https://github.com/llvm/llvm-project/commit/a8bc9c3f0fe68e61790931e3de28f24f73d4fd37.diff

LOG: Use new DWARFDataExtractor::getInitialLength in DWARFVerifier

Added: 
    

Modified: 
    llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
index 68bacbfda467..c96dcebf2494 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
@@ -112,11 +112,9 @@ bool DWARFVerifier::verifyUnitHeader(const DWARFDataExtractor DebugInfoData,
   bool ValidAbbrevOffset = true;
 
   uint64_t OffsetStart = *Offset;
-  Length = DebugInfoData.getU32(Offset);
-  if (Length == dwarf::DW_LENGTH_DWARF64) {
-    Length = DebugInfoData.getU64(Offset);
-    isUnitDWARF64 = true;
-  }
+  DwarfFormat Format;
+  std::tie(Length, Format) = DebugInfoData.getInitialLength(Offset);
+  isUnitDWARF64 = Format == DWARF64;
   Version = DebugInfoData.getU16(Offset);
 
   if (Version >= 5) {


        


More information about the llvm-commits mailing list