From b8a26e7585cd76d3fbc679653bf93d3ebd2ed3e5 Mon Sep 17 00:00:00 2001 From: Camm Maguire Date: Mon, 2 Jun 2014 22:16:52 +0000 Subject: fix argument double eval on tail recursion --- gcl/cmpnew/gcl_cmpeval.lsp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcl/cmpnew/gcl_cmpeval.lsp b/gcl/cmpnew/gcl_cmpeval.lsp index d5ffe6bf..8015f402 100755 --- a/gcl/cmpnew/gcl_cmpeval.lsp +++ b/gcl/cmpnew/gcl_cmpeval.lsp @@ -1474,13 +1474,14 @@ (let* ((sir (cll fun)) (tag (cadr sir)) (targs (if la (append args (list la)) args)) - (inl (mi3 fun args la fms tag envl (mapcar 'cons targs fms)))) + (inls (mapcar 'cons targs fms)) + (inl (mi3 fun args la fms tag envl inls))) (cond (inl (keyed-cmpnote (list 'inline (if (fun-p fun) (fun-name fun) fun)) "inlining ~s ~s ~s" fun (mapcar (lambda (x) (info-type (cadr x))) fms) la) inl) ((and sir (member fun *c1exit*)) (keyed-cmpnote (list 'tail-recursion fun) "tail recursive call to ~s replaced with iteration" fun) - (c1expr (blla-recur tag (caddr sir) args la)))))) + (c1let-* (cdr (blla-recur tag (caddr sir) args la)) t inls))))) ;; (defun mi2 (fun args la fms envl) ;; (let* ((sir (cll fun)) -- cgit v1.2.3