]> Cypherpunks repositories - gostls13.git/commit
reflect: store receiver in pointer slot for reflect call
authorCherry Mui <cherryyz@google.com>
Fri, 20 May 2022 23:35:44 +0000 (19:35 -0400)
committerCherry Mui <cherryyz@google.com>
Mon, 23 May 2022 18:40:59 +0000 (18:40 +0000)
commit74f0ccb68b60a07a8730e16043f18d3749c15648
tree7cc4ce4a1eff18be084c2e2fed3f24d8d613d841
parentc1d197a96e3b3ed6ce585a5e6115586c85de0363
reflect: store receiver in pointer slot for reflect call

The code comment says that the receiver doesn't need to go into
the pointer slot as it will be kept alive in this frame. But it
doesn't. There is no direct reference of rcvr or v (the receiver)
after storing the arguments. Also, it is clearer to explicitly
keep it alive.

Fixes #52800.

Change-Id: Ie3fa8e83f6ecc69d62e8bfab767314d5181f5dc0
Reviewed-on: https://go-review.googlesource.com/c/go/+/407508
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/reflect/value.go