1
0
mirror of https://github.com/golang/go synced 2024-09-29 19:24:33 -06:00
The Go programming language
Go to file
Michael Anthony Knyszek 9d46ee5ac4 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 <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2021-06-12 00:12:55 +00:00
.github .github: add link to questions in ISSUE_TEMPLATE 2020-01-06 17:05:31 +00:00
api api: promote next to go1.17 2021-06-09 22:49:08 +00:00
doc doc/go1.17: clean up formatting of gofmt section 2021-06-11 16:09:15 +00:00
lib/time lib/time, time/tzdata: update tzdata to 2021a 2021-01-25 16:08:46 +00:00
misc misc/cgo/errors: use expected column numbers 2021-06-05 04:40:03 +00:00
src reflect: handle stack-to-register translation in callMethod 2021-06-12 00:12:55 +00:00
test cmd/compile: make map.zero symbol content-addressable 2021-06-09 02:18:34 +00:00
.gitattributes all: treat all files as binary, but check in .bat with CRLF 2020-06-08 15:31:43 +00:00
.gitignore internal/buildcfg: move build configuration out of cmd/internal/objabi 2021-04-16 19:20:53 +00:00
AUTHORS A+C: update name 2021-06-01 17:08:12 +00:00
codereview.cfg codereview.cfg: add codereview.cfg for master branch 2021-02-19 18:44:53 +00:00
CONTRIBUTING.md
CONTRIBUTORS A+C: update name 2021-06-01 17:08:12 +00:00
LICENSE
PATENTS
README.md README: pull gopher image from website 2021-02-16 18:25:10 +00:00
SECURITY.md

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.

Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at https://golang.org/dl/.

After downloading a binary release, visit https://golang.org/doc/install for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source for source installation instructions.

Contributing

Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines at https://golang.org/doc/contribute.html.

Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.