jss: invoke-restargs compiled was evaluating the first argument twice

(Alan Ruttenberg)

Example to show bug:

    (defun foo () (#"replaceAll" (progn (print 'hi) "foo") "foo" "bar"))

Before fix, hi printed twice, after once.

Merges <https://github.com/armedbear/abcl/pull/77>
parent db8934de
......@@ -23,13 +23,16 @@
(if raw?
`(jstatic-raw ,method ,object-as-class ,@args)
`(jstatic ,method ,object-as-class ,@args))))
(let ((objectvar (make-symbol "INVOKE-RESTARGS-ARG1")))
(if raw?
`(if (symbolp ,object)
(jstatic-raw ,method (find-java-class ,object) ,@args)
(jcall-raw ,method ,object ,@args))
`(if (symbolp ,object)
(jstatic ,method (find-java-class ,object) ,@args)
(jcall ,method ,object ,@args)))))
`(let ((,objectvar ,object))
(if (symbolp ,objectvar)
(jstatic-raw ,method (find-java-class ,objectvar) ,@args)
(jcall-raw ,method ,objectvar ,@args)))
`(let ((,objectvar ,object))
(if (symbolp ,objectvar)
(jstatic ,method (find-java-class ,objectvar) ,@args)
(jcall ,method ,objectvar ,@args)))))))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment