Update lua

This commit is contained in:
Cloud Wu
2022-11-16 10:28:38 +08:00
parent 94a76269aa
commit 499610965a
33 changed files with 494 additions and 1168 deletions

View File

@@ -260,9 +260,7 @@ static int getfield (lua_State *L, const char *key, int d, int delta) {
res = d;
}
else {
/* unsigned avoids overflow when lua_Integer has 32 bits */
if (!(res >= 0 ? (lua_Unsigned)res <= (lua_Unsigned)INT_MAX + delta
: (lua_Integer)INT_MIN + delta <= res))
if (!(res >= 0 ? res - delta <= INT_MAX : INT_MIN + delta <= res))
return luaL_error(L, "field '%s' is out-of-bound", key);
res -= delta;
}