From d232af70f2ef150ea41537de50a0ade92ecd7e3a Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Wed, 25 Dec 2019 17:58:03 +0800 Subject: [PATCH] fix #1139 --- lualib-src/lua-multicast.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lualib-src/lua-multicast.c b/lualib-src/lua-multicast.c index 4588bd10..dab90ee2 100644 --- a/lualib-src/lua-multicast.c +++ b/lualib-src/lua-multicast.c @@ -141,7 +141,8 @@ static int mc_nextid(lua_State *L) { uint32_t id = (uint32_t)luaL_checkinteger(L, 1); id += 256; - lua_pushinteger(L, (uint32_t)id); + // remove the highest bit, see #1139 + lua_pushinteger(L, id & 0x7fffffffu); return 1; }