Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 11fb1ad

Browse files
committedJun 2, 2025··
[Concurrency] Prefer swift_auth_code_function over swift_auth_code
This allows us to use constants, and not hardcoded numbers
1 parent c8d15aa commit 11fb1ad

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎stdlib/public/Concurrency/Task.cpp‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,8 @@ swift_task_addCancellationHandlerImpl(
17631763
void *context) {
17641764
void *allocation =
17651765
swift_task_alloc(sizeof(CancellationNotificationStatusRecord));
1766-
auto unsigned_handler = swift_auth_code(handler, 3848);
1766+
auto unsigned_handler = swift_auth_code_function(handler,
1767+
SpecialPointerAuthDiscriminators::CancellationNotificationFunction);
17671768
auto *record = ::new (allocation)
17681769
CancellationNotificationStatusRecord(unsigned_handler, context);
17691770

@@ -1816,7 +1817,8 @@ swift_task_addPriorityEscalationHandlerImpl(
18161817
void *context) {
18171818
void *allocation =
18181819
swift_task_alloc(sizeof(EscalationNotificationStatusRecord));
1819-
auto unsigned_handler = swift_auth_code(handler, 30817);
1820+
auto unsigned_handler = swift_auth_code_function(handler,
1821+
SpecialPointerAuthDiscriminators::EscalationNotificationFunction);
18201822
auto *record = ::new (allocation)
18211823
EscalationNotificationStatusRecord(unsigned_handler, context);
18221824

0 commit comments

Comments
 (0)
Please sign in to comment.