Skip to main content

runtime_error

Function runtime_error 

Source
pub extern "C" fn runtime_error(kind: u64) -> *mut u8
Expand description

Called by JIT code for runtime errors (divZeroError, overflowError). Sets a thread-local error flag and returns a “poison” Lit(Int#, 0) object instead of null. This prevents JIT code from segfaulting on the return value. The effect machine checks the error flag after JIT returns and converts to Yield::Error. kind: 0 = divZeroError, 1 = overflowError, 2 = UserError, 3 = Undefined