Skip to content

[Concurrency] Fix ptr auth for task priority escalation handler #81229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/swift/ABI/MetadataValues.h
Original file line number Diff line number Diff line change
Expand Up @@ -1745,7 +1745,7 @@ namespace SpecialPointerAuthDiscriminators {
const uint16_t AsyncContextParent = 0xbda2; // = 48546
const uint16_t AsyncContextResume = 0xd707; // = 55047
const uint16_t AsyncContextYield = 0xe207; // = 57863
const uint16_t CancellationNotificationFunction = 0x1933; // = 6451
const uint16_t CancellationNotificationFunction = 0x2E3F; // = 11839 (TaskPriority, TaskPriority) -> Void
const uint16_t EscalationNotificationFunction = 0x7861; // = 30817
const uint16_t AsyncThinNullaryFunction = 0x0f08; // = 3848
const uint16_t AsyncFutureFunction = 0x720f; // = 29199
Expand Down
3 changes: 2 additions & 1 deletion stdlib/public/Concurrency/Task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1812,8 +1812,9 @@ swift_task_addPriorityEscalationHandlerImpl(
void *context) {
void *allocation =
swift_task_alloc(sizeof(EscalationNotificationStatusRecord));
auto unsigned_handler = swift_auth_code(handler, 11839);
auto *record = ::new (allocation)
EscalationNotificationStatusRecord(handler, context);
EscalationNotificationStatusRecord(unsigned_handler, context);

addStatusRecordToSelf(record, [&](ActiveTaskStatus oldStatus, ActiveTaskStatus& newStatus) {
return true;
Expand Down