From a1370860642076caf23f4aca084c5df8a46d7d7e Mon Sep 17 00:00:00 2001 From: Timidger Date: Sun, 29 Oct 2017 15:26:40 -0700 Subject: [PATCH] Check that we have enough room on stack for module --- src/lua.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lua.rs b/src/lua.rs index 18c0ca7..b9cdfe9 100644 --- a/src/lua.rs +++ b/src/lua.rs @@ -562,6 +562,7 @@ impl Lua { /// The debug library is very unsound, loading it and using it breaks all /// the guarantees of rlua. pub unsafe fn load_debug(&self) { + check_stack(self.state, 1); ffi::luaL_requiref(self.state, cstr!("debug"), ffi::luaopen_debug, 1); ffi::lua_pop(self.state, 1); }