[Lldb-commits] [lldb] 2182eda - [LLDB] Switch from using member_clang_type.GetByteSize() to member_type->GetByteSize() in ParseSingleMember
Shafik Yaghmour via lldb-commits
lldb-commits at lists.llvm.org
Mon May 17 10:36:42 PDT 2021
Author: Shafik Yaghmour
Date: 2021-05-17T10:36:35-07:00
New Revision: 2182eda3062471e2e6994307c46ffcca7e39ecff
URL: https://github.com/llvm/llvm-project/commit/2182eda3062471e2e6994307c46ffcca7e39ecff
DIFF: https://github.com/llvm/llvm-project/commit/2182eda3062471e2e6994307c46ffcca7e39ecff.diff
LOG: [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
Added:
Modified:
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 55fd5897c370..744be00a9992 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -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;
}
More information about the lldb-commits
mailing list