plugins/lua/lua.c: fix segfault on lua_pop with Lua 5.4.3

Closes #2558

Co-authored-by: "Jan Alexander Steffens (heftig)" <[email protected]>
Signed-off-by: Mateusz Gozdek <[email protected]>
This commit is contained in:
Mateusz Gozdek
2021-04-04 21:17:05 -05:00
committed by Patrick
co-authored by Jan Alexander Steffens (heftig)
parent 090fd29acf
commit 90c91d6c9a
+1 -1
View File
@@ -1189,11 +1189,11 @@ static void patch_clibs(lua_State *L)
if(lua_type(L, -2) == LUA_TLIGHTUSERDATA && lua_type(L, -1) == LUA_TTABLE) if(lua_type(L, -2) == LUA_TLIGHTUSERDATA && lua_type(L, -1) == LUA_TTABLE)
{ {
lua_setfield(L, LUA_REGISTRYINDEX, "_CLIBS"); lua_setfield(L, LUA_REGISTRYINDEX, "_CLIBS");
lua_pop(L, 1);
break; break;
} }
lua_pop(L, 1); lua_pop(L, 1);
} }
lua_pop(L, 1);
} }
static GPtrArray *scripts; static GPtrArray *scripts;