mirror of
https://github.com/golang/go
synced 2024-11-19 02:14:43 -07:00
parent
42c26b734c
commit
410927d1ad
@ -257,6 +257,17 @@ gen(Node *n)
|
||||
break;
|
||||
|
||||
case OIF:
|
||||
if(n->ntest == N || n->ntest->op == OLITERAL) {
|
||||
// drop dead code in if true or if false.
|
||||
// the linker will do it for us in general,
|
||||
// but this avoids writnig to the object file
|
||||
// in a very common case.
|
||||
if(n->ntest == N || n->ntest->val.u.bval)
|
||||
genlist(n->nbody);
|
||||
else
|
||||
genlist(n->nelse);
|
||||
break;
|
||||
}
|
||||
p1 = gjmp(P); // goto test
|
||||
p2 = gjmp(P); // p2: goto else
|
||||
patch(p1, pc); // test:
|
||||
|
Loading…
Reference in New Issue
Block a user