From a634bf88fdbf60a8353f4744704c1f54f1fba90c Mon Sep 17 00:00:00 2001 From: Julian Bouzas Date: Tue, 26 Jan 2021 10:24:46 -0500 Subject: [PATCH] wplua: fix vtables lookup in boxed __index function --- lib/wplua/boxed.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/wplua/boxed.c b/lib/wplua/boxed.c index 8f3b106b..467e7305 100644 --- a/lib/wplua/boxed.c +++ b/lib/wplua/boxed.c @@ -33,7 +33,8 @@ _wplua_gboxed___index (lua_State *L) lua_CFunction func = NULL; GHashTable *vtables; - lua_getglobal (L, "__wplua_vtables"); + lua_pushliteral (L, "wplua_vtables"); + lua_gettable (L, LUA_REGISTRYINDEX); vtables = wplua_toboxed (L, -1); lua_pop (L, 1);