Skip to content
New issue

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 panic() doesn't work #3731

Open
dgryski opened this issue May 17, 2023 · 2 comments
Open

defer panic() doesn't work #3731

dgryski opened this issue May 17, 2023 · 2 comments
Labels
bug Something isn't working core

Comments

@dgryski
Copy link
Member

dgryski commented May 17, 2023

~/go/src/github.com/dgryski/bug/defpan $ tinygo run main.go
todo: builtin: panic
todo: builtin: panic
~/go/src/github.com/dgryski/bug/defpan $ cat main.go
package main

func main() {
	println("before")
	defer panic("panic")
	println("after")
}

panic is *ssa.Panic which isn't handled by defer (or createBuiltin?). I guess we need to turn it into a b.createRuntimeInvoke("_panic", ...).

@deadprogram deadprogram added bug Something isn't working core labels May 18, 2023
@joonas
Copy link

joonas commented Oct 30, 2024

just wanted to chime in here that I'm also interested in this, but not quite sure how I could best help move things along 🙂

@aykevl
Copy link
Member

aykevl commented Oct 31, 2024

Here is a fix: #4571

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core
Projects
None yet
Development

No branches or pull requests

4 participants