From 2592aeb85e1d2c3ba27357c2d921c6176c86e02a Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 4 Feb 2024 11:25:31 +0100 Subject: [PATCH] bug fix - https://github.com/lua/lua/commit/42cf5f8214edf45400c7e4abd6faef27cf424801 --- client/deps/liblua/lbitlib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/deps/liblua/lbitlib.c b/client/deps/liblua/lbitlib.c index 090e52b8b..f36ec0265 100644 --- a/client/deps/liblua/lbitlib.c +++ b/client/deps/liblua/lbitlib.c @@ -128,7 +128,9 @@ static int b_rot(lua_State *L, int i) { b_uint r = luaL_checkunsigned(L, 1); i &= (LUA_NBITS - 1); /* i = i % NBITS */ r = trim(r); - r = (r << i) | (r >> (LUA_NBITS - i)); + if (i != 0) /* avoid undefined shift of LUA_NBITS when i == 0 */ + r = (r << i) | (r >> (LUA_NBITS - i)); + lua_pushunsigned(L, trim(r)); return 1; }