diff options
author | Austin Clements <austin@google.com> | 2021-07-23 15:03:00 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2021-07-30 18:49:41 +0000 |
commit | ea94e5d3c57fadea088cdc5002e014b3c7ef4bc1 (patch) | |
tree | 6bdf36c5ced4fb4ff263f20f454410f2a0cb2c40 /src/runtime/runtime2.go | |
parent | 4480e3b11ab6dcd8d4c6a1e87388f573ff49f429 (diff) | |
download | go-ea94e5d3c57fadea088cdc5002e014b3c7ef4bc1.tar.gz go-ea94e5d3c57fadea088cdc5002e014b3c7ef4bc1.zip |
[dev.typeparams] runtime: use func() for deferred functions
Prior to regabi, a deferred function could have any signature, so the
runtime always manipulated them as funcvals. Now, a deferred function
is always func(). Hence, this CL makes the runtime's manipulation of
deferred functions more type-safe by using func() directly instead of
*funcval.
Change-Id: Ib55f38ed49107f74149725c65044e4690761971d
Reviewed-on: https://go-review.googlesource.com/c/go/+/337650
Trust: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/runtime/runtime2.go')
-rw-r--r-- | src/runtime/runtime2.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index 83d7d50b19..b5e4b3dec8 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -953,10 +953,10 @@ type _defer struct { // defers. We have only one defer record for the entire frame (which may // currently have 0, 1, or more defers active). openDefer bool - sp uintptr // sp at time of defer - pc uintptr // pc at time of defer - fn *funcval // can be nil for open-coded defers - _panic *_panic // panic that is running defer + sp uintptr // sp at time of defer + pc uintptr // pc at time of defer + fn func() // can be nil for open-coded defers + _panic *_panic // panic that is running defer link *_defer // If openDefer is true, the fields below record values about the stack |