** Emit code to go through if 'e' is false, jump otherwise. */
| 889 | ** Emit code to go through if 'e' is false, jump otherwise. |
| 890 | */ |
| 891 | void luaK_goiffalse (FuncState *fs, expdesc *e) { |
| 892 | int pc; /* pc of new jump */ |
| 893 | luaK_dischargevars(fs, e); |
| 894 | switch (e->k) { |
| 895 | case VJMP: { |
| 896 | pc = e->u.info; /* already jump if true */ |
| 897 | break; |
| 898 | } |
| 899 | case VNIL: case VFALSE: { |
| 900 | pc = NO_JUMP; /* always false; do nothing */ |
| 901 | break; |
| 902 | } |
| 903 | default: { |
| 904 | pc = jumponcond(fs, e, 1); /* jump if true */ |
| 905 | break; |
| 906 | } |
| 907 | } |
| 908 | luaK_concat(fs, &e->t, pc); /* insert new jump in 't' list */ |
| 909 | luaK_patchtohere(fs, e->f); /* false list jumps to here (to go through) */ |
| 910 | e->f = NO_JUMP; |
| 911 | } |
| 912 | |
| 913 | |
| 914 | /* |