| 666 | |
| 667 | |
| 668 | void codearith (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2) { |
| 669 | if (constfolding(op, e1, e2)) |
| 670 | return; |
| 671 | else { |
| 672 | int o2 = (op != OP_UNM && op != OP_LEN) ? luaK_exp2RK(fs, e2) : 0; |
| 673 | int o1 = luaK_exp2RK(fs, e1); |
| 674 | if (o1 > o2) { |
| 675 | freeexp(fs, e1); |
| 676 | freeexp(fs, e2); |
| 677 | } |
| 678 | else { |
| 679 | freeexp(fs, e2); |
| 680 | freeexp(fs, e1); |
| 681 | } |
| 682 | e1->u.s.info = luaK_codeABC(fs, op, 0, o1, o2); |
| 683 | e1->k = VRELOCABLE; |
| 684 | } |
| 685 | } |
| 686 | |
| 687 | |
| 688 | static void codecomp (FuncState *fs, OpCode op, int cond, expdesc *e1, |
no test coverage detected