From b8af64db76bc602517be300128be0dfb67fac89f Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Thu, 25 Feb 2010 13:17:34 +0100 Subject: simplify handling of nonlocal prompt returns from c * libguile/control.h: * libguile/control.c (scm_i_prompt_pop_abort_args_x): New helper. * libguile/eval.c (eval): Use the new helper. --- libguile/eval.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'libguile/eval.c') diff --git a/libguile/eval.c b/libguile/eval.c index c82e5431d..dff0372a2 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -435,20 +435,9 @@ eval (SCM x, SCM env) if (SCM_PROMPT_SETJMP (prompt)) { - /* The prompt exited nonlocally. The args are on the VM stack. */ - size_t i, n; - SCM vals = SCM_EOL; - n = scm_to_size_t (SCM_PROMPT_REGISTERS (prompt)->sp[0]); - for (i = 0; i < n; i++) - vals = scm_cons (SCM_PROMPT_REGISTERS (prompt)->sp[-(i + 1)], vals); - /* The abort did reset the VM's registers, but then these values - were pushed on; so we need to pop them ourselves. */ - SCM_VM_DATA (scm_the_vm ())->sp -= n + 1; - /* FIXME NULLSTACK */ - - /* FIXME mark cont as non-reentrant */ + /* The prompt exited nonlocally. */ proc = handler; - args = vals; + args = scm_i_prompt_pop_abort_args_x (prompt); goto apply_proc; } -- cgit v1.2.3