| 711 | |
| 712 | |
| 713 | static int constfolding (OpCode op, expdesc *e1, expdesc *e2) { |
| 714 | lua_Number r; |
| 715 | if (!isnumeral(e1) || !isnumeral(e2)) return 0; |
| 716 | if ((op == OP_DIV || op == OP_MOD) && e2->u.nval == 0) |
| 717 | return 0; /* do not attempt to divide by 0 */ |
| 718 | r = luaO_arith(op - OP_ADD + LUA_OPADD, e1->u.nval, e2->u.nval); |
| 719 | e1->u.nval = r; |
| 720 | return 1; |
| 721 | } |
| 722 | |
| 723 | |
| 724 | static void codearith (FuncState *fs, OpCode op, |
no test coverage detected