]> Cypherpunks repositories - gostls13.git/commit
runtime: count spill slot for frame size at finalizer call
authorCherry Mui <cherryyz@google.com>
Thu, 3 Mar 2022 01:16:54 +0000 (20:16 -0500)
committerCherry Mui <cherryyz@google.com>
Thu, 3 Mar 2022 18:04:51 +0000 (18:04 +0000)
commit58804ea67a28c1d8e37ed548b685bc0c09638886
tree24a166642c4ac6d89e87b9bca3beb29416d29989
parent78070ec3d44fdd8e60271abf31f056aeac919cc3
runtime: count spill slot for frame size at finalizer call

The finalizer is called using reflectcall. When register ABI is
used, the finalizer's argument is passed in register(s). But the
frame size calculation does not include the spill slot. When the
argument actually spills, it may clobber the caller's stack frame.
This CL fixes it.

Change-Id: Ibcc7507c518ba65c1c5a7759e5cab0ae3fc7efce
Reviewed-on: https://go-review.googlesource.com/c/go/+/389574
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/mfinal.go
src/runtime/mfinal_test.go