| 14571 | } |
| 14572 | |
| 14573 | inline void luajit_exception_handler(lua_State* L, int (*handler)(lua_State*, lua_CFunction) = detail::c_trampoline) { |
| 14574 | #if defined(SOL_LUAJIT) && (!defined(SOL_EXCEPTIONS_SAFE_PROPAGATION) || !(SOL_EXCEPTIONS_SAFE_PROPAGATION)) |
| 14575 | if (L == nullptr) { |
| 14576 | return; |
| 14577 | } |
| 14578 | #if defined(SOL_SAFE_STACK_CHECK) && SOL_SAFE_STACK_CHECK |
| 14579 | luaL_checkstack(L, 1, detail::not_enough_stack_space_generic); |
| 14580 | #endif // make sure stack doesn't overflow |
| 14581 | lua_pushlightuserdata(L, (void*)handler); |
| 14582 | auto pn = pop_n(L, 1); |
| 14583 | luaJIT_setmode(L, -1, LUAJIT_MODE_WRAPCFUNC | LUAJIT_MODE_ON); |
| 14584 | #else |
| 14585 | (void)L; |
| 14586 | (void)handler; |
| 14587 | #endif |
| 14588 | } |
| 14589 | |
| 14590 | inline void luajit_exception_off(lua_State* L) { |
| 14591 | #if defined(SOL_LUAJIT) |
no test coverage detected