-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[IRGen/Distributed] Adjust protocol requirement and witness table to handle distributed thunks #60184
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
Conversation
@swift-ci please test |
…lRef` While building witness table record, let's use `hasAsync()` check on `SILDeclRef` of the requirement instead of reaching for the underlying declaration because the reference should be the source of truth about `async` and other attributes. In case of distributed thunk witness, which is always `async throws`, the underlying declaration could be sync because it's the protocol requirement declaration.
… async Fixes a bug where descriptor for protocol requirement associated with distributed thunk wasn't marked as `async` that results in ptrauth failures because discriminator would be misaligned between requirement and witness. Resolves: rdar://96520492
@swift-ci please test |
@swift-ci please test apple silicon |
1 similar comment
@swift-ci please test apple silicon |
if (entry.getFunction().isDistributedThunk()) { | ||
flags = flags.withIsAsync(true); | ||
declRef = declRef.asDistributed(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okey so this piece we did yesterday did matter... 👍
@@ -1388,8 +1389,9 @@ class AccessorConformanceInfo : public ConformanceInfo { | |||
witness = llvm::ConstantExpr::getBitCast(witness, IGM.Int8PtrTy); | |||
|
|||
PointerAuthSchema schema = | |||
afd->hasAsync() ? IGM.getOptions().PointerAuth.AsyncProtocolWitnesses | |||
: IGM.getOptions().PointerAuth.ProtocolWitnesses; | |||
isAsyncRequirement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aha that's what we were missing I see 👀
Apple silicon failing to start, times out; |
@swift-ci please test apple silicon |
Also resolves rdar://97228310 |
swiftlang/swift-package-manager#5684 |
The revert got merged so the above AS run failed:
|
@swift-ci please test apple silicon |
1 similar comment
@swift-ci please test apple silicon |
Determine whether protocol requirement is async using
SILDeclRef
This is necessary because SILDeclRef of the distributed thunk witness is anchored
on the requirement declaration which might not be async, but the witness itself is
always
async throws
.Mark protocol requirement descriptor for distributed thunk as async
Fixes a bug where descriptor for protocol requirement associated with
distributed thunk wasn't marked as
async
that results in ptrauth failuresbecause discriminator would be misaligned between requirement and witness.
Resolves: rdar://96520492
Resolves: rdar://97228310