luaur-vm 0.1.3

The Luau register virtual machine and standard library (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::macros::lua_callinfo_handle::LUA_CALLINFO_HANDLE;
use crate::records::call_info::CallInfo;
use crate::records::lua_state::lua_State;

pub(crate) unsafe fn resume_findhandler(L: *mut lua_State) -> *mut CallInfo {
    let mut ci = (*L).ci;

    while ci > (*L).base_ci {
        if ((*ci).flags & LUA_CALLINFO_HANDLE as u32) != 0 {
            return ci;
        }

        ci = ci.offset(-1);
    }

    core::ptr::null_mut()
}