-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
runtime: recover calls in loop body of ranging over iterators doesn't take effect #71685
Comments
Some like #71675, but different. |
BTW, I'm not sure whether or not the panic should be caught in the following code. Now it doesn't. package main
import "fmt"
func main() {
defer foo()
panic(123)
}
func foo() {
for range iter {}
}
func iter(yield func(int) bool) {
fmt.Println(">", recover()) // > <nil>
yield(0)
} |
Related Issues
Related Documentation (Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
CC @golang/runtime. |
In triage, we think this is almost certainly the same bug as #71675. |
It looks to me that in #71675, something was done incorrectly. However, for the current issue, something was forgotten to do. |
While the symptoms look different, the underlying cause is probably the same -- recover matched to the wrong frame. And the fix is probably the same. |
This is not a duplicate; the fix for #71675 does not fix this. |
Go version
go version go1.24.0 linux/amd64
Output of
go env
in your module/workspace:.
What did you do?
What did you see happen?
What did you expect to see?
The text was updated successfully, but these errors were encountered: