From 377ee39f577cbc0cff30b135a195dfb9de67089c Mon Sep 17 00:00:00 2001 From: LoganDark Date: Mon, 8 Nov 2021 08:18:42 -0800 Subject: [PATCH] Move userdata to the beginning of lua_Callbacks --- VM/include/lua.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VM/include/lua.h b/VM/include/lua.h index c8469b90..8e7d6468 100644 --- a/VM/include/lua.h +++ b/VM/include/lua.h @@ -346,6 +346,8 @@ struct lua_Debug * can only be changed when the VM is not running any code */ struct lua_Callbacks { + void* userdata; /* arbitrary userdata pointer that is never overwritten by Luau */ + void (*interrupt)(lua_State* L, int gc); /* gets called at safepoints (loop back edges, call/ret, gc) if set */ void (*panic)(lua_State* L, int errcode); /* gets called when an unprotected error is raised (if longjmp is used) */ @@ -356,8 +358,6 @@ struct lua_Callbacks void (*debugstep)(lua_State* L, lua_Debug* ar); /* gets called after each instruction in single step mode */ void (*debuginterrupt)(lua_State* L, lua_Debug* ar); /* gets called when thread execution is interrupted by break in another thread */ void (*debugprotectederror)(lua_State* L); /* gets called when protected call results in an error */ - - void* userdata; /* arbitrary userdata pointer that is never overwritten by Luau */ }; LUA_API lua_Callbacks* lua_callbacks(lua_State* L);