diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-04-25 17:01:14 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-04-25 17:01:14 -0300 |
commit | a3f9c1a77abb2add30334160055dc2ed11eb0b2e (patch) | |
tree | 94caffdf4a6ebdff3a7418f9482c46db9fc8d663 /lcode.c | |
parent | 6dbae1b5d961a76d1e2ffd5d50d20b86290f483c (diff) | |
download | lua-a3f9c1a77abb2add30334160055dc2ed11eb0b2e.tar.gz lua-a3f9c1a77abb2add30334160055dc2ed11eb0b2e.tar.bz2 lua-a3f9c1a77abb2add30334160055dc2ed11eb0b2e.zip |
detail (using unsigned comparison in range check for LOADI)
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)); |