chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] bugfix for lfa pass


From: Felix
Subject: [Chicken-hackers] [PATCH] bugfix for lfa pass
Date: Tue, 08 Jan 2013 21:05:30 +0100 (CET)

Attached is a fix for a compiler bug in the "lfa2" phase, which
was reported by Sven Hartrumpf. The code-walker for this pass
incorrectly assumed that ##core#inline_allocate forms have at
least one argument, where in fact they may be called with
zero arguments.


cheers,
felix
>From 01ec8c4d8bfd600ff95306be430f38abdb797c36 Mon Sep 17 00:00:00 2001
From: felix <address@hidden>
Date: Mon, 7 Jan 2013 22:51:16 +0100
Subject: [PATCH] Fix bug in lfa2 pass of compiler reported by Sven Hartrumpf:

The code walker in the lfa2 pass incorrectly assumed that
---
 lfa2.scm |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lfa2.scm b/lfa2.scm
index 473663c..0fd256d 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)
-- 
1.7.0.4


reply via email to

[Prev in Thread] Current Thread [Next in Thread]