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

Comments

Projects
None yet
2 participants
@ALTree
Copy link
Member

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 this to the Go1.12 milestone Oct 6, 2018

@ALTree

This comment has been minimized.

Copy link
Member Author

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

This comment has been minimized.

Copy link

commented Oct 6, 2018

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

@gopherbot gopherbot closed this in 6933d76 Oct 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.