Fix: luaL_sandbox leaves value on the stack (#253)

Co-authored-by: Petri Häkkinen <petrih@rmd.remedy.fi>
This commit is contained in:
Petri Häkkinen 2021-11-30 18:14:28 +02:00 committed by GitHub
parent 9aa9ff12dd
commit 677994b243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ void luaL_sandbox(lua_State* L)
lua_pushliteral(L, "");
lua_getmetatable(L, -1);
lua_setreadonly(L, -1, true);
lua_pop(L, 1);
lua_pop(L, 2);
// set globals to readonly and activate safeenv since the env is immutable
lua_setreadonly(L, LUA_GLOBALSINDEX, true);