Skip to content

Commit 2c99a66

Browse files
committed
Correct priority cancellation handler signing once more
Resolves rdar://150378890 for real this time, verified on arm64e myself
1 parent d49dd18 commit 2c99a66

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

include/swift/ABI/MetadataValues.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1745,7 +1745,7 @@ namespace SpecialPointerAuthDiscriminators {
17451745
const uint16_t AsyncContextParent = 0xbda2; // = 48546
17461746
const uint16_t AsyncContextResume = 0xd707; // = 55047
17471747
const uint16_t AsyncContextYield = 0xe207; // = 57863
1748-
const uint16_t CancellationNotificationFunction = 0xf73; // = 3955 (TaskPriority, TaskPriority) -> Void
1748+
const uint16_t CancellationNotificationFunction = 0x0f08; // = 3848
17491749
const uint16_t EscalationNotificationFunction = 0x7861; // = 30817
17501750
const uint16_t AsyncThinNullaryFunction = 0x0f08; // = 3848
17511751
const uint16_t AsyncFutureFunction = 0x720f; // = 29199

include/swift/ABI/TaskStatus.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ class CancellationNotificationStatusRecord : public TaskStatusRecord {
269269
/// subsequently used.
270270
class EscalationNotificationStatusRecord : public TaskStatusRecord {
271271
public:
272-
using FunctionType = SWIFT_CC(swift) void(JobPriority, JobPriority, SWIFT_CONTEXT void *);
272+
using FunctionType = SWIFT_CC(swift) void(uint8_t, uint8_t, SWIFT_CONTEXT void *);
273273

274274
private:
275275
FunctionType *__ptrauth_swift_escalation_notification_function Function;
@@ -282,7 +282,10 @@ class EscalationNotificationStatusRecord : public TaskStatusRecord {
282282
}
283283

284284
void run(JobPriority oldPriority, JobPriority newPriority) {
285-
Function(oldPriority, newPriority, Argument);
285+
Function(
286+
static_cast<size_t>(oldPriority),
287+
static_cast<size_t>(newPriority),
288+
Argument);
286289
}
287290

288291
static bool classof(const TaskStatusRecord *record) {

stdlib/public/Concurrency/Task.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1817,7 +1817,7 @@ swift_task_addPriorityEscalationHandlerImpl(
18171817
void *context) {
18181818
void *allocation =
18191819
swift_task_alloc(sizeof(EscalationNotificationStatusRecord));
1820-
auto unsigned_handler = swift_auth_code(handler, 3955);
1820+
auto unsigned_handler = swift_auth_code(handler, 30817);
18211821
auto *record = ::new (allocation)
18221822
EscalationNotificationStatusRecord(unsigned_handler, context);
18231823

0 commit comments

Comments
 (0)