cmp: unoptimized long call: evaluate the function first

Fixes #550.
This commit is contained in:
Daniel Kochmański 2020-01-12 11:18:46 +01:00
parent e399d33fc6
commit 3743c85d4d

View file

@ -18,10 +18,12 @@
(in-package "COMPILER")
(defun unoptimized-long-call (fun arguments)
(let ((frame (gensym)))
(let ((frame (gensym))
(f-arg (gensym)))
`(with-stack ,frame
,@(loop for i in arguments collect `(stack-push ,frame ,i))
(si::apply-from-stack-frame ,frame ,fun))))
(let ((,f-arg ,fun))
,@(loop for i in arguments collect `(stack-push ,frame ,i))
(si::apply-from-stack-frame ,frame ,f-arg)))))
(defun unoptimized-funcall (fun arguments)
(let ((l (length arguments)))