From: Peter van Dijk Date: Tue, 21 Oct 2025 17:11:22 +0000 (+0200) Subject: luawrapper: correct lua_pop argument X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6b1e764cdddea74c380d62dd044bed536b042754;p=thirdparty%2Fpdns.git luawrapper: correct lua_pop argument a negative argument to _pop has defined behaviour but never does what the user expects. Note that none of this matters as Lua will adjust the stack to the 1 top item, which is the pushed boolean, after `return 1` but I get confused every time I read the negative version Signed-off-by: Peter van Dijk --- diff --git a/ext/luawrapper/include/LuaContext.hpp b/ext/luawrapper/include/LuaContext.hpp index b7de2c1c43..46f865d549 100644 --- a/ext/luawrapper/include/LuaContext.hpp +++ b/ext/luawrapper/include/LuaContext.hpp @@ -123,7 +123,7 @@ public: lua_gettable(lua, -2); /* if not found, return false */ if (lua_isnil(lua, -1)) { - lua_pop(lua, -2); + lua_pop(lua, 2); lua_pushboolean(lua, false); return 1; }