Skip to content

Commit c9e095b

Browse files
committed
Swift: handle type resolution failure more gracefully
The result of the type resolution was not verified which resulted in the debugger trying to resolve a function from a `nullptr` and subsequently crash. This adds a check to ensure that we resolved the type before proceeding.
1 parent d07bd3c commit c9e095b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntimeDynamicTypeResolution.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,8 @@ SwiftLanguageRuntimeImpl::GetMemberVariableOffsetRemoteAST(
788788
// Check whether we've already cached this offset.
789789
swift::TypeBase *swift_type =
790790
GetCanonicalSwiftType(instance_type).getPointer();
791+
if (swift_type == nullptr)
792+
return {};
791793

792794
// Perform the cache lookup.
793795
MemberID key{swift_type, ConstString(member_name).GetCString()};

0 commit comments

Comments
 (0)