diff options
author | Andy Wingo <wingo@pobox.com> | 2008-10-02 11:00:55 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2008-10-02 11:00:55 +0200 |
commit | 9a8cc8e7f736bda93706dc74e6ab8f07621dd341 (patch) | |
tree | 7f156621c5db8b2fe8ce9ebd6cb76036fb26cd29 /libguile/vm-i-system.c | |
parent | 7e91e01dd85ae4a54f7f4c41bbb174fb73cddeeb (diff) | |
download | guile-9a8cc8e7f736bda93706dc74e6ab8f07621dd341.tar.gz |
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.
Diffstat (limited to 'libguile/vm-i-system.c')
-rw-r--r-- | libguile/vm-i-system.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c index db6d0a722..9a0e028a5 100644 --- a/libguile/vm-i-system.c +++ b/libguile/vm-i-system.c @@ -840,8 +840,7 @@ VM_DEFINE_INSTRUCTION (apply, "apply", 1, -1, 1) POP (ls); nargs = FETCH (); - if (nargs < 2) - goto vm_error_wrong_num_args; + ASSERT (nargs >= 2); len = scm_ilength (ls); if (len < 0) @@ -861,8 +860,7 @@ VM_DEFINE_INSTRUCTION (goto_apply, "goto/apply", 1, -1, 1) POP (ls); nargs = FETCH (); - if (nargs < 2) - goto vm_error_wrong_num_args; + ASSERT (nargs >= 2); len = scm_ilength (ls); if (len < 0) @@ -895,7 +893,7 @@ VM_DEFINE_INSTRUCTION (call_cc, "call/cc", 0, 1, 1) SCM values; values = scm_struct_ref (cont, SCM_INUM0); if (SCM_NULLP (values)) - goto vm_error_wrong_num_args; + goto vm_error_no_values; /* non-tail context does not accept multiple values? */ PUSH (SCM_CAR (values)); NEXT; |