Skip to content

Commit 5643c37

Browse files
committed
fix: move parent assignment to else branch
1 parent fc1478f commit 5643c37

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lldb/source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,15 +466,16 @@ void UdtRecordCompleter::Record::ConstructRecord() {
466466
}
467467
if (iter->second.empty())
468468
continue;
469-
parent = iter->second.back();
470469

471470
// For structs, if the new fields come after the already added ones
472471
// without overlap, go back to the root struct.
473-
if (parent != &record && iter->first <= offset &&
474-
record.kind == Member::Struct && is_last_end_offset(iter))
472+
if (iter->first <= offset && record.kind == Member::Struct &&
473+
is_last_end_offset(iter))
475474
parent = &record;
476-
else
475+
else {
476+
parent = iter->second.back();
477477
iter->second.pop_back();
478+
}
478479
}
479480
// If it's a field, then the field is inside a union, so we can safely
480481
// increase its size by converting it to a struct to hold multiple fields.

0 commit comments

Comments
 (0)