Skip to content

Commit 1537a28

Browse files
committed
[TypeChecker] add defensive nullptr checks
should resolve rdar://97339014
1 parent f512c4b commit 1537a28

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)