We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
defer
Looks like the panic in the defer block causes the defer to rerun, when it shouldn't.
panic
~/go/src/github.com/dgryski/bug/repanic $ cat main.go package main func main() { var rerun int defer func() { println("defer") if r := recover(); r != nil { rerun++ if rerun < 5 { panic(r) } } }() panic("boom") } ~/go/src/github.com/dgryski/bug/repanic $ go run main.go defer panic: boom [recovered] panic: boom goroutine 1 [running]: main.main.func1() /Users/dgryski/go/src/github.com/dgryski/bug/repanic/main.go:10 +0x6d panic({0x105ba80, 0x107a8b8}) /Users/dgryski/go/src/go.googlesource.com/go/src/runtime/panic.go:884 +0x213 main.main() /Users/dgryski/go/src/github.com/dgryski/bug/repanic/main.go:15 +0x6c exit status 2 ~/go/src/github.com/dgryski/bug/repanic $ tinygo run main.go defer defer defer defer defer
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Looks like the
panic
in thedefer
block causes thedefer
to rerun, when it shouldn't.The text was updated successfully, but these errors were encountered: