]> granicus.if.org Git - llvm/commitdiff
[DebugInfo] Fix use-after-move warning. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 8 May 2019 10:09:57 +0000 (10:09 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 8 May 2019 10:09:57 +0000 (10:09 +0000)
Don't rely on DWARFAbbreviationDeclarationSet::extract cleaning the struct up for reuse - the analyzers don't like it.

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

lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp

index f46545ff3d214d9ccf836391025f7a23a9d1b62d..31b324e5eb2760476b97abb352b9642a1ea86912 100644 (file)
@@ -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)));