1
0
mirror of https://github.com/golang/go synced 2024-11-25 12:17:56 -07:00
R=r
OCL=27987
CL=27987
This commit is contained in:
Ken Thompson 2009-04-28 13:52:56 -07:00
parent f2714e38a4
commit 91ce0ef8f3
3 changed files with 4 additions and 6 deletions

View File

@ -632,6 +632,7 @@ bgen(Node *n, int true, Prog *to)
switch(n->op) { switch(n->op) {
default: default:
def:
regalloc(&n1, n->type, N); regalloc(&n1, n->type, N);
cgen(n, &n1); cgen(n, &n1);
nodconst(&n2, n->type, 0); nodconst(&n2, n->type, 0);
@ -644,12 +645,14 @@ bgen(Node *n, int true, Prog *to)
goto ret; goto ret;
case OLITERAL: case OLITERAL:
// need to ask if it is bool? // need to ask if it is bool?
if(!true == !n->val.u.bval) if(!true == !n->val.u.bval)
patch(gbranch(AJMP, T), to); patch(gbranch(AJMP, T), to);
goto ret; goto ret;
case ONAME: case ONAME:
if(n->addable == 0)
goto def;
nodconst(&n1, n->type, 0); nodconst(&n1, n->type, 0);
gins(optoas(OCMP, n->type), n, &n1); gins(optoas(OCMP, n->type), n, &n1);
a = AJNE; a = AJNE;

View File

@ -106,11 +106,6 @@ BUG: compilation succeeds incorrectly
=========== bugs/bug136.go =========== bugs/bug136.go
BUG: should not compile 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
bugs/bug140.go:6: syntax error near L1 bugs/bug140.go:6: syntax error near L1
bugs/bug140.go:7: syntax error near L2 bugs/bug140.go:7: syntax error near L2