0
1
mirror of https://github.com/golang/go synced 2025-08-07 01:11:44 +00:00
Files
go/test/fixedbugs/issue73916.go
Keith Randall 08376e1a9c runtime: iterate through inlinings when processing recover()
We care about the wrapper-ness of logical frames, not physical frames.

Fixes #73916
Fixes #73917
Fixex #73920

Change-Id: Ia17c8390e71e6c0e13e23dcbb7bc7273ef25da90
Reviewed-on: https://go-review.googlesource.com/c/go/+/685375
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2025-07-25 11:26:30 -07:00

33 lines
472 B
Go

// run
// Copyright 2025 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
func callRecover() {
if recover() != nil {
println("recovered")
}
}
func F(int) { callRecover() }
func main() {
mustPanic(func() {
defer F(1)
panic("XXX")
})
}
func mustPanic(f func()) {
defer func() {
r := recover()
if r == nil {
panic("didn't panic")
}
}()
f()
}