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