]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.18] 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)
committerDmitri Shuralyov <dmitshur@golang.org>
Mon, 7 Mar 2022 16:31:22 +0000 (16:31 +0000)
commitce427cf96128b545ae473983bafb6a0b80ecaa08
tree5007c017b7ce80356629734c58912b2ca6b23034
parent79cf7c839bffa7d6c8a24620ae4670b7e08bf732
[release-branch.go1.18] 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.

Fixes #51457.

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/+/388995
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
src/runtime/mfinal.go
src/runtime/mfinal_test.go