From 65b07dd53d7938a60112fc4473f5cad3473e3534 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 11 Mar 2024 14:05:06 -0300 Subject: API asserts for illegal pops of to-be-closed variables --- ldebug.c | 1 + 1 file changed, 1 insertion(+) (limited to 'ldebug.c') diff --git a/ldebug.c b/ldebug.c index aa3277cb..daa979af 100644 --- a/ldebug.c +++ b/ldebug.c @@ -245,6 +245,7 @@ LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) { lua_lock(L); name = luaG_findlocal(L, ar->i_ci, n, &pos); if (name) { + api_checkpop(L, 1); setobjs2s(L, pos, L->top.p - 1); L->top.p--; /* pop value */ } -- cgit v1.2.3-55-g6feb