diff --git a/VM/src/lstate.cpp b/VM/src/lstate.cpp index 0b2dfb69..5b40f519 100644 --- a/VM/src/lstate.cpp +++ b/VM/src/lstate.cpp @@ -181,6 +181,7 @@ lua_State* lua_newstate(lua_Alloc f, void* ud) g->cb = lua_Callbacks(); g->gcstats = GCStats(); + g->userdata = NULL; if (luaD_rawrunprotected(L, f_luaopen, NULL) != 0) { diff --git a/VM/src/lstate.h b/VM/src/lstate.h index 56379883..90c1375d 100644 --- a/VM/src/lstate.h +++ b/VM/src/lstate.h @@ -189,6 +189,8 @@ typedef struct global_State GCStats gcstats; + void* userdata; + } global_State; // clang-format on