]> Cypherpunks repositories - gostls13.git/commit
reflect: align first argument in callMethod
authorCherry Zhang <cherryyz@google.com>
Wed, 14 Aug 2019 13:50:51 +0000 (09:50 -0400)
committerCherry Zhang <cherryyz@google.com>
Wed, 14 Aug 2019 19:49:15 +0000 (19:49 +0000)
commit5f45a3337ec78f303fbbcadd89d459af56183724
tree8e29b69cc7042ec61a1094046a6f954a4cb114ab
parentad4ed87f80c33f23bdd3767ef3208f15a1fb5c90
reflect: align first argument in callMethod

When calling a function obtained from reflect.Value.Method (or
MethodByName), we copy the arguments from the caller frame, which
does not include the receiver, to a new frame to call the actual
method, which does include the receiver. Here we need to align
the first (non-receiver) argument. As the receiver is pointer
sized, it is generally naturally aligned, except on amd64p32,
where the argument can have larger alignment, and this aligning
becomes necessary.

Fixes #33628.

Change-Id: I5bea0e20173f06d1602c5666d4f334e3d0de5c1e
Reviewed-on: https://go-review.googlesource.com/c/go/+/190297
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/reflect/all_test.go
src/reflect/value.go