diff --git a/llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp b/llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp --- a/llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp @@ -159,9 +159,8 @@ // Add the byte size of ULEB that for the abbrev Code so we can start // skipping the attribute data. uint64_t Offset = DIEOffset + CodeByteSize; - uint32_t AttrIndex = 0; for (const auto &Spec : AttributeSpecs) { - if (*MatchAttrIndex == AttrIndex) { + if (Spec.Attr == Attr) { // We have arrived at the attribute to extract, extract if from Offset. if (Spec.isImplicitConst()) return DWARFFormValue::createFromSValue(Spec.Form, @@ -177,7 +176,6 @@ else DWARFFormValue::skipValue(Spec.Form, DebugInfoData, &Offset, U.getFormParams()); - ++AttrIndex; } return None; }