From: Simon Pilgrim Date: Wed, 8 May 2019 10:09:57 +0000 (+0000) Subject: [DebugInfo] Fix use-after-move warning. NFCI. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2057585852ce6689e509871903d5cd8ab2c28eb3;p=llvm [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360235 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp b/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp index f46545ff3d2..31b324e5eb2 100644 --- a/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp +++ b/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp @@ -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)));