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
+2 -1
View File
@@ -27,6 +27,7 @@
#include <cstring>
#include <vector>
#include <set>
namespace love
{
@@ -63,7 +64,7 @@ public:
Type getType() const { return type; }
static Variant fromLua(lua_State *L, int n, bool allowTables = true);
static Variant fromLua(lua_State *L, int n, std::set<const void*> *tableSet = nullptr);
void toLua(lua_State *L) const;
private: