]> Cypherpunks repositories - gostls13.git/commitdiff
gc: bug264
authorRuss Cox <rsc@golang.org>
Tue, 4 May 2010 00:51:48 +0000 (17:51 -0700)
committerRuss Cox <rsc@golang.org>
Tue, 4 May 2010 00:51:48 +0000 (17:51 -0700)
Fixes #692.

R=ken2
CC=golang-dev
https://golang.org/cl/1092041

src/cmd/gc/sinit.c
test/fixedbugs/bug264.go [moved from test/bugs/bug264.go with 91% similarity]
test/golden.out

index 6f0772b63eb7cb18e282b27ae6dee039f1a50710..20822542ab97302af02334796a1d495be4f86002 100644 (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;
        }
 
similarity index 91%
rename from test/bugs/bug264.go
rename to test/fixedbugs/bug264.go
index e0b288d94a07ee6f81817e9ca3258eaef1141fbe..6d86c6fe5bdddccabb875675dd847b74ceb7c09c 100644 (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
 }
 
index 59aec777bc3e6dab4caadcf1673b77718bc3f9b8..49bca4b874b17eba73c447c88bc23ba74813597b 100644 (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