Skip to content

Commit c269677

Browse files
committed
[Runtime] Don't fail conformances when the global actor hook is missing
When the concurrency library's "is current global actor" hook is not available, assume that we are already executing on the right global actor. This mimics the behavior of earlier standard libraries when faced with an isolated conformance, as well as dealing with odd configurations where the code might not load the concurrency library yet At the moment, WebAssembly ends up in this configuration because we don't run the initialization for the concurrency library. That makes this also a workaround for issue #82682 / rdar://154762027.
1 parent ee5f4df commit c269677

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stdlib/public/runtime/ProtocolConformance.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1474,8 +1474,9 @@ static bool swift_isInConformanceExecutionContextImpl(
14741474
return true;
14751475

14761476
if (context->globalActorIsolationType) {
1477+
// If the hook is not installed, assume we're on the right actor.
14771478
if (!_swift_task_isCurrentGlobalActorHook)
1478-
return false;
1479+
return true;
14791480

14801481
// Check whether we are running on this global actor.
14811482
if (!_swift_task_isCurrentGlobalActorHook(

0 commit comments

Comments
 (0)