diff options
author | Andy Wingo <wingo@pobox.com> | 2008-10-16 13:24:39 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2008-10-16 13:24:39 +0200 |
commit | 1f40459f5cd2389d0a44b6c46d431ed58f450f3a (patch) | |
tree | 0de6be1a41b25c4652c0372f8b25b6920a1cffac /libguile/vm-engine.c | |
parent | 28a2f57bde42030e96b4c2ab574336c6e8c394b5 (diff) | |
download | guile-1f40459f5cd2389d0a44b6c46d431ed58f450f3a.tar.gz |
ensure that lists pushed onto the stack are proper
I saw this problem when running elisp.test -- it tries to apply a
function to an arglist ending in nil, which obviously is not null.
* libguile/vm-engine.h (PUSH_LIST): New helper macro, pushes the elements
of a list onto the stack. Checks to make sure that the list is proper.
* libguile/vm-i-system.c (list-break, mv-call, apply, goto/apply)
(goto/cc): Use LIST_BREAK.
* libguile/vm-engine.c (vm_error_improper_list): New error case.
Diffstat (limited to 'libguile/vm-engine.c')
-rw-r--r-- | libguile/vm-engine.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c index a79786015..3956a389d 100644 --- a/libguile/vm-engine.c +++ b/libguile/vm-engine.c @@ -176,6 +176,10 @@ vm_run (SCM vm, SCM program, SCM args) err_args = SCM_EOL; goto vm_error; + vm_error_improper_list: + err_msg = scm_from_locale_string ("VM: Attempt to unroll an improper list: tail is ~A"); + goto vm_error; + vm_error_no_values: err_msg = scm_from_locale_string ("VM: 0-valued return"); err_args = SCM_EOL; |