luaur_vm/macros/
lua_r_lookupmemberatoffset.rs1#[allow(non_upper_case_globals)]
6#[macro_export]
7macro_rules! luaR_lookupmemberatoffset {
8 ($inst:expr, $offset:expr) => {{
9 let inst = $inst;
10 let offset = $offset;
11 luaur_common::LUAU_ASSERT!(
12 $crate::macros::lua_r_checkoffsetinbounds::luaR_checkoffsetinbounds!(inst, offset)
13 );
14 unsafe {
15 if offset < (*(*inst).lclass).numberofinstancemembers {
16 (*inst).members.add(offset as usize)
17 } else {
18 (*(*inst).lclass)
19 .staticmembers
20 .add((offset - (*(*inst).lclass).numberofinstancemembers) as usize)
21 }
22 }
23 }};
24}
25
26pub use luaR_lookupmemberatoffset;