aboutsummaryrefslogtreecommitdiff
path: root/lcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'lcode.c')
-rw-r--r--lcode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lcode.c b/lcode.c
index 31f23f47..80d975cb 100644
--- a/lcode.c
+++ b/lcode.c
@@ -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);