~ chicken-core (chicken-5) 1114be676122a84d44bf8b479fd8a5d904b3c2d4


commit 1114be676122a84d44bf8b479fd8a5d904b3c2d4
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Mon Jan 7 22:51:16 2013 +0100
Commit:     Peter Bex <peter.bex@xs4all.nl>
CommitDate: Sat Jan 12 11:17:39 2013 +0100

    Fix bug in lfa2 pass of compiler reported by Sven Hartrumpf:
    
    The code walker in the lfa2 pass incorrectly assumed that ##core#inline_allocate forms have at least one argument, where in fact they may be called with zero arguments.
    
    Signed-off-by: Peter Bex <peter.bex@xs4all.nl>

diff --git a/lfa2.scm b/lfa2.scm
index 473663ce..0fd256d5 100644
--- a/lfa2.scm
+++ b/lfa2.scm
@@ -337,8 +337,9 @@
 			    'boolean)))))
 		 ((assoc (first params) +constructor-map+) =>
 		  (lambda (a)
-		    (let ((arg1 (first subs)))
-		      (if (and (eq? '*struct* (cadr a))
+		    (let ((arg1 (and (pair? subs) (first subs))))
+		      (if (and arg1
+			       (eq? '*struct* (cadr a))
 			       (eq? 'quote (node-class arg1)))
 			  (let ((tag (first (node-parameters arg1))))
 			    (if (symbol? tag)
Trap