From 414962d38fcc49da057fb05fb5de85abb41a5994 Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Wed, 25 Feb 2015 16:51:26 +0100 Subject: make sure that _LOADED is not nil --- c-api/compat-5.3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c-api/compat-5.3.c b/c-api/compat-5.3.c index 2fdd36d..962b951 100644 --- a/c-api/compat-5.3.c +++ b/c-api/compat-5.3.c @@ -510,7 +510,7 @@ COMPAT53_API size_t lua_stringtonumber (lua_State *L, const char *s) { COMPAT53_API void luaL_requiref (lua_State *L, const char *modname, lua_CFunction openf, int glb) { luaL_checkstack(L, 3, "not enough stack slots available"); - lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); + luaL_getsubtable(L, LUA_REGISTRYINDEX, "_LOADED"); if (lua_getfield(L, -1, modname) == LUA_TNIL) { lua_pop(L, 1); lua_pushcfunction(L, openf); -- cgit v1.2.3-55-g6feb