]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: do not clobber arguments for reflect.callReflect and callMethod's ABI...
authorCherry Zhang <cherryyz@google.com>
Fri, 16 Apr 2021 21:29:38 +0000 (17:29 -0400)
committerCherry Zhang <cherryyz@google.com>
Mon, 19 Apr 2021 23:17:10 +0000 (23:17 +0000)
commit3711ea0b5d1bc381bda02ec3fe16369ed997eda6
treed4abb93a3dbe09ccc5c4a4f79055ed4f76fd2142
parentb3a5640397e887514a860b9eb73e125c2b650f7b
cmd/compile: do not clobber arguments for reflect.callReflect and callMethod's ABI wrappers

reflect.callReflect and reflect.callMethod are called from special
functions makeFuncStub and methodValueCall. The runtime expects
that it can find the first argument (ctxt) at 0(SP) in
makeFuncStub and methodValueCall's frame. Normally callReflect and
callMethod already do not modify the argument, and keep it alive.
But the compiler-generated ABI wrappers don't do that. Special
case the wrappers to not clobber its arguments.

Change-Id: I1769f49b81c38eabe452d561001c418352814d86
Reviewed-on: https://go-review.googlesource.com/c/go/+/310889
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/compile/internal/liveness/plive.go