-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Concurrency: fix inconsistent _asyncLet_get signatures #41487
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
Concurrency: fix inconsistent _asyncLet_get signatures #41487
Conversation
@swift-ci Please smoke test |
@swift-ci please test Windows platform |
preset=buildbot_incremental_linux_crosscompile_wasm |
This is an ABI breaking change, but all use of |
@swift-ci please test macOS platform |
5c7c328
to
61e093e
Compare
@swift-ci please test |
61e093e
to
588cd71
Compare
588cd71
to
30b9fc9
Compare
@swift-ci please test |
Func _asyncLet_get(_:_:) has mangled name changing from '_Concurrency._asyncLet_get(Builtin.RawPointer, Builtin.RawPointer) async -> Builtin.RawPointer' to '_Concurrency._asyncLet_get(Builtin.RawPointer, Builtin.RawPointer) async -> ()' | ||
Func _asyncLet_get(_:_:) has return type change from Builtin.RawPointer to () | ||
Func _asyncLet_get_throwing(_:_:) has mangled name changing from '_Concurrency._asyncLet_get_throwing(Builtin.RawPointer, Builtin.RawPointer) async throws -> Builtin.RawPointer' to '_Concurrency._asyncLet_get_throwing(Builtin.RawPointer, Builtin.RawPointer) async throws -> ()' | ||
Func _asyncLet_get_throwing(_:_:) has return type change from Builtin.RawPointer to () |
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.
The declarations are annotated with _silgen_name
, so the emitted symbols ought to remain the same even though the signature changed. Is this just a bug in the API digester that it flags it as an ABI change?
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.
It seems there was a patch to use mangled name instead of USR #39846 but reverted for some reason. cf. #39906 #39920 (comment)
@nkcsgexi Could you tell me the reason if possible?
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.
OK. This change looks like it should be ABI-neutral as long as I'm not missing something.
OK, let's go ahead. The api-digester issue will be fixed in another PR. CC @nkcsgexi |
The implementation of
swift_asyncLet_get
asynchronously returns only async context, and the result is written in the given buffer. But its Swift level declaration in Concurrency module hasasync -> Builtin.RawPointer
result.This extra result type affects the number of parameters of a resumption function that is passed as a continuation function of
swift_asyncLet_get
, and it results in having an extra parameter in a resumption function.But the implementation only passes only async context to the resumption function, so callee and caller signatures are mismatched. It causes crash in WebAssembly target.
This patch fixes the signature inconsistency between the caller and callee assumptions.
https://github.com/apple/swift/blob/b0043966cd868e06fdebbfe1ae16b20d954d8089/stdlib/public/Concurrency/AsyncLet.cpp#L228-L247
Link: swiftwasm#4288