diff options
Diffstat (limited to 'lcode.c')
| -rw-r--r-- | lcode.c | 6 |
1 files changed, 5 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lcode.c,v 2.80 2014/03/06 13:39:05 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 2.81 2014/03/06 13:58:28 roberto Exp roberto $ |
| 3 | ** Code generator for Lua | 3 | ** Code generator for Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -754,7 +754,11 @@ void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { | |||
| 754 | ** return false if folding can raise an error | 754 | ** return false if folding can raise an error |
| 755 | */ | 755 | */ |
| 756 | static int validop (OpCode op, TValue *v1, TValue *v2) { | 756 | static int validop (OpCode op, TValue *v1, TValue *v2) { |
| 757 | lua_Number a, b; | ||
| 757 | lua_Integer i; | 758 | lua_Integer i; |
| 759 | (void)a; (void)b; /* macro may not use its arguments */ | ||
| 760 | if (luai_numinvalidop(op, (tonumber(v1, &a), a), (tonumber(v2, &b), b))) | ||
| 761 | return 0; | ||
| 758 | switch (op) { | 762 | switch (op) { |
| 759 | case LUA_OPIDIV: /* division by 0 and conversion errors */ | 763 | case LUA_OPIDIV: /* division by 0 and conversion errors */ |
| 760 | return (tointeger(v1, &i) && tointeger(v2, &i) && i != 0); | 764 | return (tointeger(v1, &i) && tointeger(v2, &i) && i != 0); |
