From 5aa41b436b3fdf29f5a0046c68cb60b16fa09eb2 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Fri, 30 Sep 2022 11:29:41 +0800 Subject: fix issue #81, refactor continue with gotos. --- src/3rdParty/lua/loslib.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/3rdParty/lua/loslib.c') 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) { 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; } -- cgit v1.2.3-55-g6feb