Repository navigation
[mono] Fix SwiftError variable offset calculation - #103043
Merged
matouskozak merged 3 commits intoJun 17, 2024
Merged
Conversation
Member
Author
|
/azp run runtime-extra-platforms |
Contributor
|
Tagging subscribers to this area: @lambdageek, @steveisok |
This was referenced Jun 4, 2024
Member
Author
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This was referenced Jun 5, 2024
kotlarmilos
marked this pull request as ready for review
June 6, 2024 07:13
jkoritzinsky
approved these changes
Jun 7, 2024
Member
Author
|
@matouskozak @jkurdek Please take a look at these changes. |
matouskozak
approved these changes
Jun 13, 2024
matouskozak
left a comment
Member
There was a problem hiding this comment.
The changes LGTM! and overall the code looks much cleaner to me know.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR attempts to fix CryptoKit test failure encountered in #102583. The current approach always allocates a local var for
SwiftSelfand doesn't set correct offset when the argument is passed via the stack to the wrapper.The idea is to allocate a new stack var for
SwiftErroronly when it is passed to the wrapper via regs. IfSwiftErroris passed to the wrapper via the stack, the existing stack var could be used, instead of a local variable.In the wrapper prologue, if
SwiftErroris passed to the wrapper via regs, its value should be preserved in a local variable.This is determined by checking
ainfo->offsetwhich is set inget_call_info. On amd64, ifSwiftErroris passed via regs,inregis set toFALSEand is handled in the common block for all reg arguments. Reverse pinvoke wrappers should always allocate the local variable, as the pinvoke flag inget_call_infois1, whereas for direct pinvoke, it is0.Validation
These changes should be verified using the
Interop/Swiftruntime tests and theSecurity.Cryptographylibrary tests.