Skip to content

Commit d02afa0

Browse files
authored
Merge pull request #60887 from kavon/5.7-tiny-combo-of-fixes
[5.7🍒] pair of small fixes
2 parents b545ccb + 1537a28 commit d02afa0

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

lib/SILGen/SILGenProlog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ void SILGenFunction::emitPrologGlobalActorHop(SILLocation loc,
733733
}
734734

735735
SILValue SILGenFunction::emitLoadGlobalActorExecutor(Type globalActor) {
736-
CanType actorType = CanType(globalActor);
736+
CanType actorType = globalActor->getCanonicalType();
737737
NominalTypeDecl *nominal = actorType->getNominalOrBoundGenericNominal();
738738
VarDecl *sharedInstanceDecl = nominal->getGlobalActorInstance();
739739
assert(sharedInstanceDecl && "no shared actor field in global actor");

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.

test/SILGen/hop_to_executor_async_prop.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,9 @@ struct Blah {
667667
}
668668
}
669669

670-
@MainActor
670+
typealias FancyActor = MainActor // helps cover rdar://96309577
671+
672+
@FancyActor
671673
func getTemperature() -> Int { return 0 }
672674

673675
@MainActor

0 commit comments

Comments
 (0)