]> Cypherpunks repositories - gostls13.git/commitdiff
bug 139
authorKen Thompson <ken@golang.org>
Tue, 28 Apr 2009 20:52:56 +0000 (13:52 -0700)
committerKen Thompson <ken@golang.org>
Tue, 28 Apr 2009 20:52:56 +0000 (13:52 -0700)
R=r
OCL=27987
CL=27987

src/cmd/6g/cgen.c
test/fixedbugs/bug139.go [moved from test/bugs/bug139.go with 100% similarity]
test/golden.out

index 85d86d5d632088c2dd81a38968e102439b314410..a2fbea43ecf9b5a3e17657ee7ee6b50efd89e1cf 100644 (file)
@@ -632,6 +632,7 @@ bgen(Node *n, int true, Prog *to)
 
        switch(n->op) {
        default:
+       def:
                regalloc(&n1, n->type, N);
                cgen(n, &n1);
                nodconst(&n2, n->type, 0);
@@ -644,12 +645,14 @@ bgen(Node *n, int true, Prog *to)
                goto ret;
 
        case OLITERAL:
-// need to ask if it is bool?
+               // need to ask if it is bool?
                if(!true == !n->val.u.bval)
                        patch(gbranch(AJMP, T), to);
                goto ret;
 
        case ONAME:
+               if(n->addable == 0)
+                       goto def;
                nodconst(&n1, n->type, 0);
                gins(optoas(OCMP, n->type), n, &n1);
                a = AJNE;
similarity index 100%
rename from test/bugs/bug139.go
rename to test/fixedbugs/bug139.go
index fda5e1e00017970b1ffbef9f6db6c9f770ac1cb5..a3ab91b21305077704d36203bf07f08a8f9f7e45 100644 (file)
@@ -106,11 +106,6 @@ BUG: compilation succeeds incorrectly
 =========== bugs/bug136.go
 BUG: should not compile
 
-=========== bugs/bug139.go
-bugs/bug139.go:7: fatal error: naddr: ONAME class x 5
-
-BUG should compile
-
 =========== bugs/bug140.go
 bugs/bug140.go:6: syntax error near L1
 bugs/bug140.go:7: syntax error near L2