1
0
mirror of https://github.com/golang/go synced 2024-11-21 18:54:43 -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:
break;
default:
if(isblank(n))
if(isblank(n) && n->defn != N && !n->defn->initorder) {
n->defn->initorder = 1;
*out = list(*out, n->defn);
}
return;
}

View File

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

View File

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