]> Cypherpunks repositories - gostls13.git/commit
runtime: detect successful recovers differently
authorKeith Randall <khr@golang.org>
Tue, 1 Jul 2025 21:45:45 +0000 (14:45 -0700)
committerKeith Randall <khr@golang.org>
Thu, 24 Jul 2025 23:24:36 +0000 (16:24 -0700)
commit7b5002433026cd1b0d99859bb76af12ec7ced54b
tree749a0c12ca0df9533bf220088b70915f903a24a0
parent7b9de668bd68f366d87ba50e9aeb1ba1d0bdb8e5
runtime: detect successful recovers differently

Use stack unwinding instead of keeping incremental track of the argp
of defers that are allowed to recover.

It's much simpler, and it lets us get rid of the incremental tracking
by wrapper code. (Ripped out in a subsequent CL.)

We only need to stack unwind a few frames to get the right answer, and
only when recover()ing in a panic situation. It will be more expensive
in that case, but cheaper in all others.

Change-Id: Id095807db6864b7ac1e1baf09285b77a07c46d19
Reviewed-on: https://go-review.googlesource.com/c/go/+/685355
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/runtime/panic.go
src/runtime/runtime2.go