Skip to content

cmd/compile: "VARDEF is not a top level statement" compiler crash on valid program #28055

Closed
@ALTree

Description

@ALTree
$ 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.release-blocker

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions