>>> I've seen `elisp.test' trigger a stack overflow with the interpreter
>>> more often than any other test.  Don't know why.
>>
>> I hacked around this -- see what I've pushed to vm for more info.
>
> I plan to take a look at this after the srfi-18.test hang.  (Not that
> that should stop anyone else, of course.)

Not the stack overflow yet, but see attached for fixing the elisp apply error.

It's not rocket science, and you probably guessed at that solution
already - but I think it really is the _right_ fix, because

- the principle of the elisp integration is that there is a new value
#nil, which acts as EOL in list contexts, and as #f in boolean
contexts

- as one example of this, the non-VM apply accepts and handles a list
whose tail is #nil

- therefore the VM apply should too.

What do you think?  Let me know if you'd like me to commit.  (Note I
haven't checked in detail if any of the other places that use
PUSH_LIST should definitely NOT allow a list whose tail is #nil.  If
yes, I guess we'll need two variants of PUSH_LIST.)

Regards,
       Neil
From 25ea77ee209bbacab0d07e5fb01e9d64917158f1 Mon Sep 17 00:00:00 2001
From: Neil Jerram <[EMAIL PROTECTED]>
Date: Mon, 27 Oct 2008 23:42:02 +0000
Subject: [PATCH] Fix elisp apply error (list ending with nil)

---
 libguile.h             |    1 +
 libguile/vm-engine.h   |    2 +-
 libguile/vm-i-system.c |    2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libguile.h b/libguile.h
index 40122df..d28df69 100644
--- a/libguile.h
+++ b/libguile.h
@@ -58,6 +58,7 @@ extern "C" {
 #include "libguile/rdelim.h"
 #include "libguile/rw.h"
 #include "libguile/keywords.h"
+#include "libguile/lang.h"
 #include "libguile/list.h"
 #include "libguile/load.h"
 #include "libguile/macros.h"
diff --git a/libguile/vm-engine.h b/libguile/vm-engine.h
index 215f630..b6748e1 100644
--- a/libguile/vm-engine.h
+++ b/libguile/vm-engine.h
@@ -305,7 +305,7 @@ do						\
 {						\
   for (; scm_is_pair (l); l = SCM_CDR (l))      \
     PUSH (SCM_CAR (l));                         \
-  if (SCM_UNLIKELY (!SCM_NULLP (l))) {          \
+  if (SCM_UNLIKELY (!SCM_NULL_OR_NIL_P (l))) {  \
     err_args = scm_list_1 (l);                  \
     goto vm_error_improper_list;                \
   }                                             \
diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c
index 2da2d42..4a7e439 100644
--- a/libguile/vm-i-system.c
+++ b/libguile/vm-i-system.c
@@ -39,7 +39,7 @@
  * whether to permit this exception to apply to your modifications.
  * If you do not wish that, delete this exception notice.  */
 
-/* This file is included in vm_engine.c */
+/* This file is included in vm-engine.c */
 
 
 /*
-- 
1.5.6

Reply via email to