Skip to content

Commit e78b47c

Browse files
committed
fixup! make sure to use the CU of the currently visited DIE
1 parent 5802149 commit e78b47c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,20 +285,20 @@ bool DWARFDebugInfoEntry::GetDIENamesAndRanges(
285285
/// Adds all attributes of the DIE at the top of the \c worklist to the
286286
/// \c attributes list. Specifcations and abstract origins are added
287287
/// to the \c worklist if the referenced DIE has not been seen before.
288-
static bool GetAttributes(DWARFUnit const *cu,
289-
llvm::SmallVector<DWARFDIE> &worklist,
288+
static bool GetAttributes(llvm::SmallVector<DWARFDIE> &worklist,
290289
llvm::SmallSet<DWARFDebugInfoEntry const *, 3> &seen,
291290
DWARFAttributes &attributes) {
292291
assert(!worklist.empty() && "Need at least one DIE to visit.");
293-
assert(cu && "Need a valid CU to extract attributes.");
294292
assert(seen.size() >= 1 &&
295293
"Need to have seen at least the currently visited entry.");
296294

297295
DWARFDIE current = worklist.pop_back_val();
298296

297+
const auto *cu = current.GetCU();
298+
assert(cu);
299+
299300
const auto *entry = current.GetDIE();
300-
if (!entry)
301-
return false;
301+
assert(entry);
302302

303303
const auto *abbrevDecl =
304304
entry->GetAbbreviationDeclarationPtr(current.GetCU());
@@ -371,7 +371,7 @@ DWARFAttributes DWARFDebugInfoEntry::GetAttributes(const DWARFUnit *cu,
371371
seen.insert(this);
372372

373373
do {
374-
if (!::GetAttributes(cu, worklist, seen, attributes)) {
374+
if (!::GetAttributes(worklist, seen, attributes)) {
375375
attributes.Clear();
376376
break;
377377
}

0 commit comments

Comments
 (0)