-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
go/types: missing error on an edge-case with continue/break with labels #70974
Labels
NeedsFix
The path to resolution is known, but the work has not been done.
Comments
mateusz834
added
the
NeedsFix
The path to resolution is known, but the work has not been done.
label
Dec 23, 2024
I will send a CL for this. |
mateusz834
changed the title
go/types: missing error on an edge-case with continue/break
go/types: missing error on an edge-case with continue/break with labels
Dec 23, 2024
I'm curious: how are you finding these interesting bugs? Are you using a fuzzer, or just reading skeptically? Either way, impressive. |
Change https://go.dev/cl/638257 mentions this issue: |
Change https://go.dev/cl/640895 mentions this issue: |
gopherbot
pushed a commit
that referenced
this issue
Jan 7, 2025
This case is not properly handled by the type checkers (see issue) but the compiler uses the parser's label checking so it works as expected. For #70974. Change-Id: I0849376bf7514a9a7730846649c3fe28c91f44ca Reviewed-on: https://go-review.googlesource.com/c/go/+/640895 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Alan Donovan <[email protected]> Reviewed-by: Robert Griesemer <[email protected]> Auto-Submit: Robert Griesemer <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Once again, because i am poking around with
go/types
internals, i have spotted a bug in the type-checker.The code below type-checks without any error:
This happens because
lstmt
:go/src/go/types/labels.go
Line 169 in b9955f0
is assigned and never cleared, thus:
go/src/go/types/labels.go
Lines 234 to 236 in b9955f0
is executed with a wrong label (for the second for statement).
CC @adonovan @griesemer
The text was updated successfully, but these errors were encountered: