-
Notifications
You must be signed in to change notification settings - Fork 17.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reflect: handle stack-to-register translation in callMethod
callMethod previously assumed erroneously that between the "value" and "method" ABIs (that is, the ABI the caller is following to call this method value and the actual ABI of the method), it could never happen that an argument passed on the stack in the former could be passed in registers in the latter. The cited reason was that the latter always uses strictly more registers. However, there are situations where the value ABI could pass a value on the stack, but later is passed in a register. For instance, if the receiver pushes a value passed in registers that uses multiple registers to be passed on the stack, later arguments which were passed on the stack may now be passed in registers. This change fixes callMethod to no longer makes this assumption, and handles the stack-to-register translation explicitly. Fixes #46696. Change-Id: I7100a664d97bbe401302cc893b3a98b28cdcdfc0 Reviewed-on: https://go-review.googlesource.com/c/go/+/327089 Trust: Michael Knyszek <[email protected]> Run-TryBot: Michael Knyszek <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
- Loading branch information
Showing
2 changed files
with
74 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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