[LLDB] Switch from using member_clang_type.GetByteSize() to member_type->GetByteSize() in ParseSingleMember

We have a bug in which using member_clang_type.GetByteSize() triggers record
layout and during this process since the record was not yet complete we ended
up reaching a record that had not been layed out yet.
Using member_type->GetByteSize() avoids this situation since it relies on size
from DWARF and will not trigger record layout.

For reference: rdar://77293040

Differential Revision: https://reviews.llvm.org/D102445
This commit is contained in:
Shafik Yaghmour 2021-05-17 10:34:16 -07:00
parent 0633d5ce7b
commit 2182eda306
1 changed files with 1 additions and 1 deletions

View File

@ -2671,7 +2671,7 @@ void DWARFASTParserClang::ParseSingleMember(
last_field_info.bit_offset = field_bit_offset;
if (llvm::Optional<uint64_t> clang_type_size =
member_clang_type.GetByteSize(nullptr)) {
member_type->GetByteSize(nullptr)) {
last_field_info.bit_size = *clang_type_size * character_width;
}