Skip to content

cmd/compile: extra errors with goto to a not defined label, inside function #16689

@mlowicki

Description

@mlowicki
  1. What version of Go are you using (go version)?
go version go1.6.2 darwin/amd64
  1. What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/mlowicki/projects/golang/hello"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT="1"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
  1. What did you do?

https://play.golang.org/p/aX9ZT1kspY

  1. What did you expect to see?

Error:
prog.go:4: label End not defined

so the same as with:

package main

func main() {
    goto End
}

which causes "label End not defined" error.

  1. What did you see instead?

Two errors:
prog.go:4: label End not defined
prog.go:8: label End·1 not defined

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions