/
githubmirror
/
go
Обзор
Документация
Войти
/
githubmirror
/
go
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/fixedbugs/issue73916b.go
34 строки
500 B
Keith Randall
runtime: iterate through inlinings when processing recover()
25 июл 2025, 21:26
25 июл 2025, 21:26
08376e1
Код
Авторство
О чём код?
// 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() { func() { if recover() != nil { println("recovered") } }() } func F() int { callRecover(); return 0 } func main() { mustPanic(func() { defer F() panic("XXX") }) } func mustPanic(f func()) { defer func() { r := recover() if r == nil { panic("didn't panic") } }() f() }