OSDN Git Service

Pass DWARFUnit to verifier by reference not by value. I am moderately
authorPaul Robinson <paul.robinson@sony.com>
Fri, 29 Jun 2018 19:17:44 +0000 (19:17 +0000)
committerPaul Robinson <paul.robinson@sony.com>
Fri, 29 Jun 2018 19:17:44 +0000 (19:17 +0000)
sure this should not cause a memory leak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336007 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/DebugInfo/DWARF/DWARFVerifier.h
lib/DebugInfo/DWARF/DWARFVerifier.cpp

index 71bf8f9..a829510 100644 (file)
@@ -152,7 +152,7 @@ private:
   ///                  type of the unit DIE.
   ///
   /// \returns true if the content is verified successfully, false otherwise.
-  bool verifyUnitContents(DWARFUnit Unit, uint8_t UnitType = 0);
+  bool verifyUnitContents(DWARFUnit &Unit, uint8_t UnitType = 0);
 
   /// Verify that all Die ranges are valid.
   ///
index bb52f06..82d52c4 100644 (file)
@@ -171,7 +171,7 @@ bool DWARFVerifier::verifyUnitHeader(const DWARFDataExtractor DebugInfoData,
   return Success;
 }
 
-bool DWARFVerifier::verifyUnitContents(DWARFUnit Unit, uint8_t UnitType) {
+bool DWARFVerifier::verifyUnitContents(DWARFUnit &Unit, uint8_t UnitType) {
   uint32_t NumUnitErrors = 0;
   unsigned NumDies = Unit.getNumDIEs();
   for (unsigned I = 0; I < NumDies; ++I) {