Skip to content

Commit 8e2daa7

Browse files
Merge pull request #7313 from adrian-prantl/113766264
Add missing nullptr check
2 parents 46ac717 + 77c3701 commit 8e2daa7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lldb/source/Plugins/ExpressionParser/Swift/SwiftUserExpression.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -503,22 +503,22 @@ static bool CanEvaluateExpressionWithoutBindingGenericParams(
503503
if (!self_type)
504504
return false;
505505

506-
auto *ts = self_type.GetTypeSystem()
507-
.dyn_cast_or_null<TypeSystemSwift>()
508-
->GetSwiftASTContext();
509-
506+
auto ts = self_type.GetTypeSystem().dyn_cast_or_null<TypeSystemSwift>();
510507
if (!ts)
511508
return false;
512509

513-
auto swift_type = ts->GetSwiftType(self_type);
510+
auto *swift_ast_ctx = ts->GetSwiftASTContext();
511+
if (!swift_ast_ctx)
512+
return false;
513+
514+
auto swift_type = swift_ast_ctx->GetSwiftType(self_type);
514515
if (!swift_type)
515516
return false;
516517

517518
auto *decl = swift_type->getAnyGeneric();
518519
if (!decl)
519520
return false;
520521

521-
522522
auto *env = decl->getGenericEnvironment();
523523
if (!env)
524524
return false;

0 commit comments

Comments
 (0)