diff options
| author | Keith Randall <khr@golang.org> | 2025-07-01 14:45:45 -0700 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2025-07-24 16:24:36 -0700 |
| commit | 7b5002433026cd1b0d99859bb76af12ec7ced54b (patch) | |
| tree | 749a0c12ca0df9533bf220088b70915f903a24a0 /src/runtime/runtime2.go | |
| parent | 7b9de668bd68f366d87ba50e9aeb1ba1d0bdb8e5 (diff) | |
| download | go-7b5002433026cd1b0d99859bb76af12ec7ced54b.tar.xz | |
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>
Diffstat (limited to 'src/runtime/runtime2.go')
| -rw-r--r-- | src/runtime/runtime2.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index 527611f96a..ad8a88e4ff 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -1030,6 +1030,8 @@ type _panic struct { repanicked bool // whether this panic repanicked goexit bool deferreturn bool + + gopanicFP unsafe.Pointer // frame pointer of the gopanic frame } // savedOpenDeferState tracks the extra state from _panic that's |
