| 4261 | |
| 4262 | |
| 4263 | static void codenot (FuncState *fs, expdesc *e) { |
| 4264 | luaK_dischargevars(fs, e); |
| 4265 | switch (e->k) { |
| 4266 | case VNIL: case VFALSE: { |
| 4267 | e->k = VTRUE; |
| 4268 | break; |
| 4269 | } |
| 4270 | case VK: case VKNUM: case VTRUE: { |
| 4271 | e->k = VFALSE; |
| 4272 | break; |
| 4273 | } |
| 4274 | case VJMP: { |
| 4275 | invertjump(fs, e); |
| 4276 | break; |
| 4277 | } |
| 4278 | case VRELOCABLE: |
| 4279 | case VNONRELOC: { |
| 4280 | discharge2anyreg(fs, e); |
| 4281 | freeexp(fs, e); |
| 4282 | e->u.s.info = luaK_codeABC(fs, OP_NOT, 0, e->u.s.info, 0); |
| 4283 | e->k = VRELOCABLE; |
| 4284 | break; |
| 4285 | } |
| 4286 | default: { |
| 4287 | lua_assert(0); /* cannot happen */ |
| 4288 | break; |
| 4289 | } |
| 4290 | } |
| 4291 | /* interchange true and false lists */ |
| 4292 | { int temp = e->f; e->f = e->t; e->t = temp; } |
| 4293 | removevalues(fs, e->f); |
| 4294 | removevalues(fs, e->t); |
| 4295 | } |
| 4296 | |
| 4297 | |
| 4298 | void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { |
no test coverage detected