From 9a8cc8e7f736bda93706dc74e6ab8f07621dd341 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Thu, 2 Oct 2008 11:00:55 +0200 Subject: be more like the interpreter in signalling wrong-num-args * libguile/vm-engine.c: Call scm_wrong_num_args in the wrong-num-args case, to be more like the interpreter. * libguile/vm-engine.h (ASSERT): New macro. * libguile/vm-i-system.c (apply, goto/apply): Assert that nargs >= 2, because the compiler should always feed us correct instructions. (call/cc): If no values are returned to the continuation, signal no_values instead of wrong_num_args. --- libguile/vm-engine.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libguile/vm-engine.c') diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c index 86b19de54..4436e7bd5 100644 --- a/libguile/vm-engine.c +++ b/libguile/vm-engine.c @@ -151,8 +151,9 @@ vm_run (SCM vm, SCM program, SCM args) goto vm_error; vm_error_wrong_num_args: - err_msg = scm_from_locale_string ("VM: Wrong number of arguments"); - err_args = SCM_EOL; + /* nargs and program are valid */ + scm_wrong_num_args (program); + /* shouldn't get here */ goto vm_error; vm_error_wrong_type_apply: -- cgit v1.2.3