]> Cypherpunks repositories - gostls13.git/commit
runtime: scan defer closure in stack scan
authorCherry Zhang <cherryyz@google.com>
Wed, 27 Feb 2019 17:34:20 +0000 (12:34 -0500)
committerCherry Zhang <cherryyz@google.com>
Fri, 1 Mar 2019 16:21:29 +0000 (16:21 +0000)
commit4f4c2a79d4f952b96d58aec2926b4c894245071b
tree41c5b7f6bb790fa44f6d09a78725ba8590400f86
parentc04e47f82159f1010d7403276b3dff5ab836fd00
runtime: scan defer closure in stack scan

With stack objects, when we scan the stack, it scans defers with
tracebackdefers, but it seems to me that tracebackdefers doesn't
include the func value itself, which could be a stack allocated
closure. Scan it explicitly.

Alternatively, we can change tracebackdefers to include the func
value, which in turn needs to change the type of stkframe.

Fixes #30453.

Change-Id: I55a6e43264d6952ab2fa5c638bebb89fdc410e2b
Reviewed-on: https://go-review.googlesource.com/c/164118
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/mgcmark.go
src/runtime/stack_test.go
src/runtime/testdata/testprog/gc.go