Skip to content

Commit c07aa9c

Browse files
committed
PR #41088 triggered a machine verifier failure in optimized mode for
arm64 causing Actor.cpp to fail to compile. Workaround this bug (88700717) for now.
1 parent 508af6b commit c07aa9c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

include/swift/Runtime/Config.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ extern uintptr_t __COMPATIBILITY_LIBRARIES_CANNOT_CHECK_THE_IS_SWIFT_BIT_DIRECTL
202202
#define SWIFT_ASYNC_CONTEXT
203203
#endif
204204

205+
#if __has_attribute(optnone)
206+
#define SWIFT_OPTNONE __attribute__((optnone))
207+
#else
208+
#define SWIFT_OPTNONE
209+
#endif
210+
205211
// SWIFT_CC(swiftasync) is the Swift async calling convention.
206212
// We assume that it supports mandatory tail call elimination.
207213
#if __has_feature(swiftasynccc) && __has_attribute(swiftasynccall)

stdlib/public/Concurrency/Actor.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1564,10 +1564,13 @@ static void runOnAssumedThread(AsyncTask *task, ExecutorRef executor,
15641564
asImpl(executor.getDefaultActor())->giveUpThread(runner);
15651565
}
15661566

1567+
// TODO (rokhinip): Workaround rdar://88700717. To be removed with
1568+
// rdar://88711954
15671569
SWIFT_CC(swiftasync)
15681570
static void swift_task_switchImpl(SWIFT_ASYNC_CONTEXT AsyncContext *resumeContext,
15691571
TaskContinuationFunction *resumeFunction,
1570-
ExecutorRef newExecutor) {
1572+
ExecutorRef newExecutor) SWIFT_OPTNONE {
1573+
15711574
auto trackingInfo = ExecutorTrackingInfo::current();
15721575
auto currentExecutor =
15731576
(trackingInfo ? trackingInfo->getActiveExecutor()

0 commit comments

Comments
 (0)