Commit 907736e2 authored by Jan Ziak's avatar Jan Ziak

cmd/gc: ignore blank (_) labels in label declarations

Fixes #7538

LGTM=rsc
R=gri, rsc
CC=golang-codereviews
https://golang.org/cl/85040045
parent 51fba7d8
......@@ -301,6 +301,10 @@ gen(Node *n)
break;
case OLABEL:
if(isblanksym(n->left->sym)) {
break;
}
lab = newlab(n);
// if there are pending gotos, resolve them all to the current pc.
......
// errorcheck
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Issue 7538: blank (_) labels handled incorrectly
package p
func f() {
_:
_:
goto _ // ERROR "not defined"
}
// compile
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Issue 7538: blank (_) labels handled incorrectly
package p
func f() {
_:
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment