luaur_analysis/methods/
native_stack_guard_is_ok_native_stack_guard.rs1use crate::records::native_stack_guard::NativeStackGuard;
2use luaur_common::{FFlag, FInt};
3
4impl NativeStackGuard {
5 pub fn is_ok_2(&self) -> bool {
6 if !FFlag::LuauUseNativeStackGuard.get() || FInt::LuauStackGuardThreshold.get() <= 0 {
7 return true;
8 }
9
10 let probe: u8 = 0;
14 let sp = &probe as *const u8 as usize;
15
16 let remaining = sp.wrapping_sub(self.low);
17
18 remaining > FInt::LuauStackGuardThreshold.get() as usize
19 }
20}