Skip to content

Commit d28e4b9

Browse files
Merge pull request #2531 from apple/lldb-Add-checks-before-dereferencing-NFC-release
[lldb] Add checks before dereferencing (NFC)
2 parents b6e6f45 + 052a44d commit d28e4b9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -2926,11 +2926,11 @@ bool TypeSystemSwiftTypeRef::DumpTypeValue(
29262926
data_byte_size = 4;
29272927
break;
29282928
case eFormatAddressInfo:
2929-
if (data_byte_size == 0) {
2930-
data_byte_size = exe_scope->CalculateTarget()
2931-
->GetArchitecture()
2932-
.GetAddressByteSize();
2933-
item_count = 1;
2929+
if (data_byte_size == 0 && exe_scope) {
2930+
if (auto target_sp = exe_scope->CalculateTarget()) {
2931+
data_byte_size = target_sp->GetArchitecture().GetAddressByteSize();
2932+
item_count = 1;
2933+
}
29342934
}
29352935
break;
29362936
default:

0 commit comments

Comments
 (0)