Skip to content

Commit 0bd9280

Browse files
authored
Merge pull request swiftlang#60862 from kavon/no-nulls-pls-97339014
[TypeChecker] add defensive nullptr checks
2 parents ff3f736 + de94d8d commit 0bd9280

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,13 @@ bool swift::usesFlowSensitiveIsolation(AbstractFunctionDecl const *fn) {
124124
}
125125

126126
auto *dc = fn->getDeclContext();
127+
if (!dc)
128+
return false;
127129

128130
// Must be part of a nominal type.
129131
auto *nominal = dc->getSelfNominalTypeDecl();
130-
assert(nominal && "init/deinit not part of a nominal?");
132+
if (!nominal)
133+
return false;
131134

132135
// If it's part of an actor type, then its deinit and some of its inits use
133136
// flow-isolation.

0 commit comments

Comments
 (0)