From 0de1754b21c4ed75e9e1be941caf5f5ed1fa63b4 Mon Sep 17 00:00:00 2001 From: jyelon Date: Tue, 29 Mar 2022 15:58:30 -0400 Subject: [PATCH] Fix a stack overflow in pprint::findtables --- luprex/core/cpp/pprint.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/luprex/core/cpp/pprint.cpp b/luprex/core/cpp/pprint.cpp index 850b80a9..8185a11f 100644 --- a/luprex/core/cpp/pprint.cpp +++ b/luprex/core/cpp/pprint.cpp @@ -62,13 +62,14 @@ static void findtables(LuaStack &LS0, LuaSlot root, LuaSlot tabcount) { lua_pushvalue(L, root.index()); } while (lua_gettop(L) > top) { - lua_checkstack(L, 10); + lua_checkstack(L, 20); lua_replace(L, tab.index()); LS.rawget(count, tabcount, tab); if (LS.isnil(count)) { LS.rawset(tabcount, tab, 0); LS.set(key, LuaNil); while (LS.next(tab, key, val)) { + lua_checkstack(L, 20); if (LS.istable(key)) { lua_pushvalue(L, key.index()); }