diff options
author | Camm Maguire <camm@debian.org> | 2014-06-02 22:16:52 +0000 |
---|---|---|
committer | Camm Maguire <camm@debian.org> | 2014-06-02 22:16:52 +0000 |
commit | b8a26e7585cd76d3fbc679653bf93d3ebd2ed3e5 (patch) | |
tree | 4c6763ed7bd1bed778b0ef08c8b4bdae2cc68e98 | |
parent | 60bbd3af1678c7c7492b1cf3629ff6e4995798ce (diff) | |
download | gcl-b8a26e7585cd76d3fbc679653bf93d3ebd2ed3e5.tar.gz |
fix argument double eval on tail recursion
-rwxr-xr-x | gcl/cmpnew/gcl_cmpeval.lsp | 5 |
1 files 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)) |