You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function below enters an "endless" loop when compiled.
(defunfoo () (dotimes (i 10.0) (print i)))
This is because the dotimes value is declared as integer https://github.com/euslisp/EusLisp/blob/master/lisp/l/common.l#L150 , so in the compiled code the value 10.0 gets interpreted as a much larger number instead (pointer address?). The declaration is ignored in non-compiled code.
It should be fairly easy to remove the declaration and/or add some checks in the nstring-downcase and nstring-upcase functions, but the dotimes case seems more complicated because it should remain highly optimized and backwards compatible in non-compiled code...
The function below enters an "endless" loop when compiled.
This is because the dotimes value is declared as integer https://github.com/euslisp/EusLisp/blob/master/lisp/l/common.l#L150 , so in the compiled code the value 10.0 gets interpreted as a much larger number instead (pointer address?). The declaration is ignored in non-compiled code.
Similar problems occur in
nstring-downcase
andnstring-upcase
(https://github.com/euslisp/EusLisp/blob/master/lisp/l/string.l#L93-L107), where :start and :end are declared as integers but can be any value passed by the user.It should be fairly easy to remove the declaration and/or add some checks in the
nstring-downcase
andnstring-upcase
functions, but the dotimes case seems more complicated because it should remain highly optimized and backwards compatible in non-compiled code...Also similar to #265
The text was updated successfully, but these errors were encountered: