mirror of
https://github.com/golang/go
synced 2024-11-05 18:36:08 +00:00
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:
parent
8449863d31
commit
f739dae7db
4 changed files with 32 additions and 0 deletions
|
@ -1039,6 +1039,7 @@ static int opprec[] = {
|
|||
[OEMPTY] = -1,
|
||||
[OFALL] = -1,
|
||||
[OFOR] = -1,
|
||||
[OGOTO] = -1,
|
||||
[OIF] = -1,
|
||||
[OLABEL] = -1,
|
||||
[OPROC] = -1,
|
||||
|
|
10
test/fixedbugs/issue7023.dir/a.go
Normal file
10
test/fixedbugs/issue7023.dir/a.go
Normal 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:
|
||||
}
|
11
test/fixedbugs/issue7023.dir/b.go
Normal file
11
test/fixedbugs/issue7023.dir/b.go
Normal 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
|
10
test/fixedbugs/issue7023.go
Normal file
10
test/fixedbugs/issue7023.go
Normal 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
|
Loading…
Reference in a new issue