Skip to content

Commit 052a44d

Browse files
committed
[lldb] Add checks before dereferencing (NFC)
1 parent 70ef109 commit 052a44d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
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)