1
0
mirror of https://github.com/golang/go synced 2024-11-25 03:57:56 -07:00

gc: bug264

Fixes #692.

R=ken2
CC=golang-dev
https://golang.org/cl/1092041
This commit is contained in:
Russ Cox 2010-05-03 17:51:48 -07:00
parent f8f83e80b1
commit 32df678894
3 changed files with 3 additions and 17 deletions

View File

@ -31,8 +31,10 @@ init1(Node *n, NodeList **out)
case PFUNC: case PFUNC:
break; break;
default: default:
if(isblank(n)) if(isblank(n) && n->defn != N && !n->defn->initorder) {
n->defn->initorder = 1;
*out = list(*out, n->defn); *out = list(*out, n->defn);
}
return; return;
} }

View File

@ -8,27 +8,22 @@
package main package main
import "fmt"
var fooCount = 0 var fooCount = 0
var barCount = 0 var barCount = 0
var balCount = 0 var balCount = 0
func foo() (int, int) { func foo() (int, int) {
fooCount++ fooCount++
fmt.Println("foo")
return 0, 0 return 0, 0
} }
func bar() (int, int) { func bar() (int, int) {
barCount++ barCount++
fmt.Println("bar")
return 0, 0 return 0, 0
} }
func bal() (int, int) { func bal() (int, int) {
balCount++ balCount++
fmt.Println("bal")
return 0, 0 return 0, 0
} }

View File

@ -177,14 +177,3 @@ panic PC=xxx
=========== bugs/bug260.go =========== bugs/bug260.go
FAIL FAIL
BUG: bug260 failed BUG: bug260 failed
=========== bugs/bug264.go
foo
bar
bar
bal
bal
panic: barCount != 1
panic PC=xxx
BUG