diff options
author | Austin Clements <austin@google.com> | 2021-03-30 14:45:00 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2021-03-30 21:20:51 +0000 |
commit | e0ce0af6ef5232352852fa027fe51fa3fd01198e (patch) | |
tree | 13c52cb0f5d8469cf4744e94e15888e9c46ffe75 /src/runtime/proc.go | |
parent | 1318fb4a32371311688c6b868c3041f0501b6aeb (diff) | |
download | go-e0ce0af6ef5232352852fa027fe51fa3fd01198e.tar.gz go-e0ce0af6ef5232352852fa027fe51fa3fd01198e.zip |
runtime: check that defer/go frames are empty
With GOEXPERIMENT=regabidefer, these frames should always be empty.
Check that.
For #40724.
Change-Id: Id8e418a9e06b4f94543cb16b868a7e10e013c2d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/306009
Trust: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/proc.go')
-rw-r--r-- | src/runtime/proc.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go index c2edb40948..d868c596bf 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -4019,6 +4019,12 @@ func malg(stacksize int32) *g { // //go:nosplit func newproc(siz int32, fn *funcval) { + if experimentRegabiDefer && siz != 0 { + // TODO: When we commit to experimentRegabiDefer, + // rewrite newproc's comment, since it will no longer + // have a funny stack layout or need to be nosplit. + throw("go with non-empty frame") + } argp := add(unsafe.Pointer(&fn), sys.PtrSize) gp := getg() pc := getcallerpc() |