diff options
Diffstat (limited to 'lcode.c')
-rw-r--r-- | lcode.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1298,7 +1298,8 @@ static int validop (int op, TValue *v1, TValue *v2) { | |||
1298 | case LUA_OPBAND: case LUA_OPBOR: case LUA_OPBXOR: | 1298 | case LUA_OPBAND: case LUA_OPBOR: case LUA_OPBXOR: |
1299 | case LUA_OPSHL: case LUA_OPSHR: case LUA_OPBNOT: { /* conversion errors */ | 1299 | case LUA_OPSHL: case LUA_OPSHR: case LUA_OPBNOT: { /* conversion errors */ |
1300 | lua_Integer i; | 1300 | lua_Integer i; |
1301 | return (tointegerns(v1, &i) && tointegerns(v2, &i)); | 1301 | return (luaV_tointegerns(v1, &i, LUA_FLOORN2I) && |
1302 | luaV_tointegerns(v2, &i, LUA_FLOORN2I)); | ||
1302 | } | 1303 | } |
1303 | case LUA_OPDIV: case LUA_OPIDIV: case LUA_OPMOD: /* division by 0 */ | 1304 | case LUA_OPDIV: case LUA_OPIDIV: case LUA_OPMOD: /* division by 0 */ |
1304 | return (nvalue(v2) != 0); | 1305 | return (nvalue(v2) != 0); |