** Emit code to go through if 'e' is false, jump otherwise. */
| 1141 | ** Emit code to go through if 'e' is false, jump otherwise. |
| 1142 | */ |
| 1143 | void luaK_goiffalse (FuncState *fs, expdesc *e) { |
| 1144 | int pc; /* pc of new jump */ |
| 1145 | luaK_dischargevars(fs, e); |
| 1146 | switch (e->k) { |
| 1147 | case VJMP: { |
| 1148 | pc = e->u.info; /* already jump if true */ |
| 1149 | break; |
| 1150 | } |
| 1151 | case VNIL: case VFALSE: { |
| 1152 | pc = NO_JUMP; /* always false; do nothing */ |
| 1153 | break; |
| 1154 | } |
| 1155 | default: { |
| 1156 | pc = jumponcond(fs, e, 1); /* jump if true */ |
| 1157 | break; |
| 1158 | } |
| 1159 | } |
| 1160 | luaK_concat(fs, &e->t, pc); /* insert new jump in 't' list */ |
| 1161 | luaK_patchtohere(fs, e->f); /* false list jumps to here (to go through) */ |
| 1162 | e->f = NO_JUMP; |
| 1163 | } |
| 1164 | |
| 1165 | |
| 1166 | /* |