diff options
Diffstat (limited to '')
| -rw-r--r-- | src/3rdParty/lua/loslib.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/3rdParty/lua/loslib.c b/src/3rdParty/lua/loslib.c index 3e20d62..854dcf6 100644 --- a/src/3rdParty/lua/loslib.c +++ b/src/3rdParty/lua/loslib.c | |||
| @@ -260,9 +260,7 @@ static int getfield (lua_State *L, const char *key, int d, int delta) { | |||
| 260 | res = d; | 260 | res = d; |
| 261 | } | 261 | } |
| 262 | else { | 262 | else { |
| 263 | /* unsigned avoids overflow when lua_Integer has 32 bits */ | 263 | if (!(res >= 0 ? res - delta <= INT_MAX : INT_MIN + delta <= res)) |
| 264 | if (!(res >= 0 ? (lua_Unsigned)res <= (lua_Unsigned)INT_MAX + delta | ||
| 265 | : (lua_Integer)INT_MIN + delta <= res)) | ||
| 266 | return luaL_error(L, "field '%s' is out-of-bound", key); | 264 | return luaL_error(L, "field '%s' is out-of-bound", key); |
| 267 | res -= delta; | 265 | res -= delta; |
| 268 | } | 266 | } |
