From 0c5ba41b72a19f5353083431a1817d86bc3b7fad Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Tue, 2 Mar 2021 17:23:12 +0100 Subject: Fix two compiler ICEs dealing with nan and infinity * lisp/emacs-lisp/comp-cstr.el (comp-cstr-=): Don't crash when truncate fails. * test/src/comp-test-funcs.el (comp-test-=-nan): Add two functions to be compiled. --- lisp/emacs-lisp/comp-cstr.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lisp/emacs-lisp/comp-cstr.el') diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index 996502b2869..6a8ec5213d5 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -871,9 +871,12 @@ Non memoized version of `comp-cstr-intersection-no-mem'." ;; precisely as an integer add the integer as well. (cl-loop for v in (valset cstr) - when (and (floatp v) - (= v (truncate v))) - do (push (cons (truncate v) (truncate v)) (range cstr))) + do + (when-let* ((ok (floatp v)) + (truncated (ignore-error 'overflow-error + (truncate v))) + (ok (= v truncated))) + (push (cons truncated truncated) (range cstr)))) (cl-loop with vals-to-add for (l . h) in (range cstr) -- cgit v1.2.3