luaur_vm/functions/
lua_g_onbreak.rs1use crate::enums::lua_type::lua_Type;
6use crate::records::lua_state::lua_State;
7use luaur_common::enums::luau_opcode::LuauOpcode;
8use luaur_common::macros::luau_insn_op::LUAU_INSN_OP;
9
10#[no_mangle]
11#[allow(non_snake_case)]
12pub unsafe fn luaG_onbreak(l: *mut lua_State) -> bool {
13 if (*l).ci == (*l).base_ci {
14 return false;
15 }
16
17 let func = (*(*l).ci).func;
20 if (*func).tt() != lua_Type::LUA_TFUNCTION as core::ffi::c_int {
21 return false;
22 }
23 if (*(*(*func).value.gc).cl).isC != 0 {
24 return false;
25 }
26
27 LUAU_INSN_OP(*(*(*l).ci).savedpc) == LuauOpcode::LOP_BREAK as u32
28}