Add Lua 5.4 (rc2) support

This commit is contained in:
Alex Orlenko
2020-05-08 12:42:40 +01:00
parent 5c226b4915
commit 539b569ff4
15 changed files with 181 additions and 58 deletions
+3 -2
View File
@@ -129,7 +129,9 @@ impl<'lua> Thread<'lua> {
}
ffi::lua_xmove(lua.state, thread_state, nargs);
let ret = ffi::lua_resume(thread_state, lua.state, nargs);
let mut nresults = 0;
let ret = ffi::lua_resume(thread_state, lua.state, nargs, &mut nresults as *mut c_int);
if ret != ffi::LUA_OK && ret != ffi::LUA_YIELD {
protect_lua_closure(lua.state, 0, 0, |_| {
error_traceback(thread_state);
@@ -138,7 +140,6 @@ impl<'lua> Thread<'lua> {
return Err(pop_error(thread_state, ret));
}
let nresults = ffi::lua_gettop(thread_state);
let mut results = MultiValue::new();
ffi::lua_xmove(thread_state, lua.state, nresults);