** Emit code to go through if 'e' is false, jump otherwise. */
| 1159 | ** Emit code to go through if 'e' is false, jump otherwise. |
| 1160 | */ |
| 1161 | void luaK_goiffalse (FuncState *fs, expdesc *e) { |
| 1162 | int pc; /* pc of new jump */ |
| 1163 | luaK_dischargevars(fs, e); |
| 1164 | switch (e->k) { |
| 1165 | case VJMP: { |
| 1166 | pc = e->u.info; /* already jump if true */ |
| 1167 | break; |
| 1168 | } |
| 1169 | case VNIL: case VFALSE: { |
| 1170 | pc = NO_JUMP; /* always false; do nothing */ |
| 1171 | break; |
| 1172 | } |
| 1173 | default: { |
| 1174 | pc = jumponcond(fs, e, 1); /* jump if true */ |
| 1175 | break; |
| 1176 | } |
| 1177 | } |
| 1178 | luaK_concat(fs, &e->t, pc); /* insert new jump in 't' list */ |
| 1179 | luaK_patchtohere(fs, e->f); /* false list jumps to here (to go through) */ |
| 1180 | e->f = NO_JUMP; |
| 1181 | } |
| 1182 | |
| 1183 | |
| 1184 | /* |