| 592 | |
| 593 | |
| 594 | static void codenot (FuncState *fs, expdesc *e) { |
| 595 | luaK_dischargevars(fs, e); |
| 596 | switch (e->k) { |
| 597 | case VNIL: case VFALSE: { |
| 598 | e->k = VTRUE; |
| 599 | break; |
| 600 | } |
| 601 | case VK: case VKNUM: case VTRUE: { |
| 602 | e->k = VFALSE; |
| 603 | break; |
| 604 | } |
| 605 | case VJMP: { |
| 606 | invertjump(fs, e); |
| 607 | break; |
| 608 | } |
| 609 | case VRELOCABLE: |
| 610 | case VNONRELOC: { |
| 611 | discharge2anyreg(fs, e); |
| 612 | freeexp(fs, e); |
| 613 | e->u.s.info = luaK_codeABC(fs, OP_NOT, 0, e->u.s.info, 0); |
| 614 | e->k = VRELOCABLE; |
| 615 | break; |
| 616 | } |
| 617 | default: { |
| 618 | lua_assert(0); /* cannot happen */ |
| 619 | break; |
| 620 | } |
| 621 | } |
| 622 | /* interchange true and false lists */ |
| 623 | { int temp = e->f; e->f = e->t; e->t = temp; } |
| 624 | removevalues(fs, e->f); |
| 625 | removevalues(fs, e->t); |
| 626 | } |
| 627 | |
| 628 | |
| 629 | void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { |
no test coverage detected