]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.17] runtime: count spill slot for frame size at finalizer call
authorCherry Mui <cherryyz@google.com>
Thu, 3 Mar 2022 18:35:44 +0000 (13:35 -0500)
committerHeschi Kreinick <heschi@google.com>
Mon, 14 Mar 2022 17:45:32 +0000 (17:45 +0000)
commit88be85f18bf0244a2470fdf6719e1b5ca5a5e50a
treeb3434de78c0c013cf13af648c2cea64eae0d6d37
parent7dd10d4ce20e64d96a10cb67794851a58d96a2aa
[release-branch.go1.17] 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.

Updates #51457.
Fixes #51458.

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>
(cherry picked from commit 58804ea67a28c1d8e37ed548b685bc0c09638886)
Reviewed-on: https://go-review.googlesource.com/c/go/+/389794
src/runtime/mfinal.go
src/runtime/mfinal_test.go