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

cmd/compile: fails to reject empty blocks after fallthrough statement #14540

Closed
mdempsky opened this issue Feb 27, 2016 · 2 comments
Closed

cmd/compile: fails to reject empty blocks after fallthrough statement #14540

mdempsky opened this issue Feb 27, 2016 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@mdempsky
Copy link
Member

cmd/compile accepts this source:

package f

func g() {
        switch {
        case true:
                fallthrough
                {}
        case false:
        }
}

It shouldn't.

(See also #14422.)

@bradfitz bradfitz added this to the Go1.7 milestone Apr 10, 2016
@rsc rsc modified the milestones: Go1.8, Go1.7 May 17, 2016
@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 11, 2016
@rsc rsc modified the milestones: Go1.9, Go1.8 Oct 21, 2016
@josharian
Copy link
Contributor

The problem here is that order.go eliminates the empty block before it gets to walk, which is where this error ("fallthrough statement out of place") is usually detected.

It seems to me that this error can be easily detected syntactically and that we should move the error checking for it much earlier, perhaps to noder. But not for 1.9.

@josharian josharian modified the milestones: Go1.10, Go1.9 May 18, 2017
@gopherbot
Copy link

Change https://golang.org/cl/61130 mentions this issue: cmd/compile: eliminate OXFALL

@golang golang locked and limited conversation to collaborators Sep 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

6 participants