aboutsummaryrefslogtreecommitdiff
path: root/lcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'lcode.c')
-rw-r--r--lcode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lcode.c b/lcode.c
index 5ca597eb..c36a49ad 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.c,v 2.130 2017/10/04 21:56:32 roberto Exp roberto $ 2** $Id: lcode.c,v 2.131 2017/11/07 17:20:42 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*/
@@ -611,7 +611,7 @@ static void luaK_float (FuncState *fs, int reg, lua_Number f) {
611 TValue v; 611 TValue v;
612 lua_Integer fi; 612 lua_Integer fi;
613 setfltvalue(&v, f); 613 setfltvalue(&v, f);
614 if (luaV_tointeger(&v, &fi, 0) && 614 if (luaV_flttointeger(&v, &fi, 0) &&
615 l_castS2U(fi) + MAXARG_sBx <= l_castS2U(MAXARG_Bx)) 615 l_castS2U(fi) + MAXARG_sBx <= l_castS2U(MAXARG_Bx))
616 luaK_codeAsBx(fs, OP_LOADF, reg, cast_int(fi)); 616 luaK_codeAsBx(fs, OP_LOADF, reg, cast_int(fi));
617 else 617 else
@@ -1146,7 +1146,7 @@ static int validop (int op, TValue *v1, TValue *v2) {
1146 case LUA_OPBAND: case LUA_OPBOR: case LUA_OPBXOR: 1146 case LUA_OPBAND: case LUA_OPBOR: case LUA_OPBXOR:
1147 case LUA_OPSHL: case LUA_OPSHR: case LUA_OPBNOT: { /* conversion errors */ 1147 case LUA_OPSHL: case LUA_OPSHR: case LUA_OPBNOT: { /* conversion errors */
1148 lua_Integer i; 1148 lua_Integer i;
1149 return (tointeger(v1, &i) && tointeger(v2, &i)); 1149 return (tointegerns(v1, &i) && tointegerns(v2, &i));
1150 } 1150 }
1151 case LUA_OPDIV: case LUA_OPIDIV: case LUA_OPMOD: /* division by 0 */ 1151 case LUA_OPDIV: case LUA_OPIDIV: case LUA_OPMOD: /* division by 0 */
1152 return (nvalue(v2) != 0); 1152 return (nvalue(v2) != 0);