Skip to main content

try_eval_unwinding

Function try_eval_unwinding 

Source
unsafe fn try_eval_unwinding(expr: SEXP, env: SEXP) -> Caught
Expand description

Evaluate expr in env in the caller’s R context, with error conditions caught (catch_error): the caller’s handlers and restarts stay in place, and any other R exit leaves as a Rust unwind (call_unwinding). Never Caught::Exit.

The slot is protected before the evaluation and holds the caught condition until the caller roots it. An exit jumps to R_UnwindProtect’s frame, which resets the protect stack to its level when the frame was entered, so the slot’s protection is still the top one when the unwind drops it.

§Safety

As try_eval_with_handlers.