Check that we have enough room on stack for module

This commit is contained in:
Timidger 2017-10-29 15:26:40 -07:00
parent 71fdca5477
commit a137086064
1 changed files with 1 additions and 0 deletions

View File

@ -562,6 +562,7 @@ impl Lua {
/// The debug library is very unsound, loading it and using it breaks all /// The debug library is very unsound, loading it and using it breaks all
/// the guarantees of rlua. /// the guarantees of rlua.
pub unsafe fn load_debug(&self) { pub unsafe fn load_debug(&self) {
check_stack(self.state, 1);
ffi::luaL_requiref(self.state, cstr!("debug"), ffi::luaopen_debug, 1); ffi::luaL_requiref(self.state, cstr!("debug"), ffi::luaopen_debug, 1);
ffi::lua_pop(self.state, 1); ffi::lua_pop(self.state, 1);
} }