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: "VARDEF is not a top level statement" compiler crash on valid program #28055

Closed
ALTree opened this issue Oct 6, 2018 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Milestone

Comments

@ALTree
Copy link
Member

ALTree commented Oct 6, 2018

$ gotip version
go version devel +8aee193fb8 Sat Oct 6 12:11:53 2018 +0000 linux/amd64
package p

func f() {
	var s string
	var as []string
	switch false && (s+"a"+as[0]+s+as[0]+s == "") {
	}
}
$ gotip build crash.go
# command-line-arguments
nottop [0xc0004cae00]
.   VARDEF l(6)
.   .   NAME-p..autotmp_2 a(true) l(6) x(0) class(PAUTO) esc(N) tc(1) addrtaken used SLICE-[6]string
./crash.go:6:21: VARDEF is not a top level statement

It compiles fine on go1.11

@ALTree ALTree added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Oct 6, 2018
@ALTree ALTree added this to the Go1.12 milestone Oct 6, 2018
@ALTree
Copy link
Member Author

ALTree commented Oct 6, 2018

Git bisect points to 9a8372f (cmd/compile,runtime: remove ambiguously live logic) as the first bad commit.

cc @randall77

@ALTree ALTree changed the title cmd/compiler: "VARDEF is not a top level statement" compiler crash on valid program cmd/compile: "VARDEF is not a top level statement" compiler crash on valid program Oct 6, 2018
@gopherbot
Copy link

Change https://golang.org/cl/140304 mentions this issue: cmd/compile: allow VARDEF at top level

@golang golang locked and limited conversation to collaborators Oct 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Projects
None yet
Development

No branches or pull requests

2 participants