[llvm] r360235 - [DebugInfo] Fix use-after-move warning. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed May 8 03:09:58 PDT 2019


Author: rksimon
Date: Wed May  8 03:09:57 2019
New Revision: 360235

URL: http://llvm.org/viewvc/llvm-project?rev=360235&view=rev
Log:
[DebugInfo] Fix use-after-move warning. NFCI.

Don't rely on DWARFAbbreviationDeclarationSet::extract cleaning the struct up for reuse - the analyzers don't like it.

Modified:
    llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp

Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp?rev=360235&r1=360234&r2=360235&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp Wed May  8 03:09:57 2019
@@ -83,12 +83,12 @@ void DWARFDebugAbbrev::parse() const {
   if (!Data)
     return;
   uint32_t Offset = 0;
-  DWARFAbbreviationDeclarationSet AbbrDecls;
   auto I = AbbrDeclSets.begin();
   while (Data->isValidOffset(Offset)) {
     while (I != AbbrDeclSets.end() && I->first < Offset)
       ++I;
     uint32_t CUAbbrOffset = Offset;
+    DWARFAbbreviationDeclarationSet AbbrDecls;
     if (!AbbrDecls.extract(*Data, &Offset))
       break;
     AbbrDeclSets.insert(I, std::make_pair(CUAbbrOffset, std::move(AbbrDecls)));




More information about the llvm-commits mailing list