diff options
Diffstat (limited to 'lcode.c')
-rw-r--r-- | lcode.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lcode.c,v 2.114 2017/04/24 20:26:39 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 2.115 2017/04/25 18:28:25 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 | */ |
@@ -516,7 +516,7 @@ static int nilK (FuncState *fs) { | |||
516 | 516 | ||
517 | 517 | ||
518 | void luaK_int (FuncState *fs, int reg, lua_Integer i) { | 518 | void luaK_int (FuncState *fs, int reg, lua_Integer i) { |
519 | if (-MAXARG_sBx <= i && i <= MAXARG_sBx) | 519 | if (l_castS2U(i) + MAXARG_sBx <= l_castS2U(MAXARG_Bx)) |
520 | luaK_codeAsBx(fs, OP_LOADI, reg, cast_int(i)); | 520 | luaK_codeAsBx(fs, OP_LOADI, reg, cast_int(i)); |
521 | else | 521 | else |
522 | luaK_codek(fs, reg, luaK_intK(fs, i)); | 522 | luaK_codek(fs, reg, luaK_intK(fs, i)); |