Skip to content

Commit 2270bcd

Browse files
committed
LanguageRuntime: ensure that we have a scratch context
We would previously not ensure that we had an initialised scratch context before we would check if we encountered any fatal errors. Protect against this case, while the experience may be degraded, this prevents the debugger from terminating abnormally.
1 parent 65f2547 commit 2270bcd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ SwiftLanguageRuntimeImpl::GetMemberVariableOffsetRemoteAST(
780780
llvm::StringRef member_name) {
781781
auto scratch_ctx =
782782
instance_type.GetTypeSystem().dyn_cast_or_null<SwiftASTContext>();
783-
if (scratch_ctx->HasFatalErrors())
783+
if (scratch_ctx == nullptr || scratch_ctx->HasFatalErrors())
784784
return {};
785785

786786
auto *remote_ast = &GetRemoteASTContext(*scratch_ctx);

0 commit comments

Comments
 (0)