cmd/gc: mark OGOTO as a statement for formatters.

Nodes of goto statements were corrupted when written
to export data.

Fixes #7023.

R=rsc, dave, minux.ma
CC=golang-codereviews
https://golang.org/cl/46190043
This commit is contained in:
Rémy Oudompheng 2014-01-10 01:33:24 +01:00
parent 8449863d31
commit f739dae7db
4 changed files with 32 additions and 0 deletions

View file

@ -1039,6 +1039,7 @@ static int opprec[] = {
[OEMPTY] = -1,
[OFALL] = -1,
[OFOR] = -1,
[OGOTO] = -1,
[OIF] = -1,
[OLABEL] = -1,
[OPROC] = -1,

View file

@ -0,0 +1,10 @@
// 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.
package a
func Foo() {
goto bar
bar:
}

View file

@ -0,0 +1,11 @@
// 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.
package b
import (
"./a"
)
var f = a.Foo

View file

@ -0,0 +1,10 @@
// compiledir
// 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 7023: corrupted export data when an inlined function
// contains a goto.
package ignored