Added cycle detection to Variant

We accidentally enabled nested tables previously, and now it errors properly when the tables contain cycles. Before you'd get (or at least I got) a nice lua stack overflow error.

--HG--
branch : minor
This commit is contained in:
Bart van Strien
2017-08-30 13:07:57 +02:00
parent d35f69bcff
commit 5ddc89a033
7 changed files with 44 additions and 18 deletions
+3 -1
View File
@@ -38,7 +38,9 @@ int w_Thread_start(lua_State *L)
for (int i = 0; i < nargs; ++i)
{
args.push_back(Variant::fromLua(L, i+2));
luax_catchexcept(L, [&]() {
args.push_back(Variant::fromLua(L, i+2));
});
if (args.back().getType() == Variant::UNKNOWN)
{