From 31af9bca99fa88350271e1a905c9b435eaec28cf Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Tue, 8 Feb 2022 16:04:15 +0100 Subject: [PATCH 1/2] Mark flymake as compatible with emacs-26.1 * lisp/progmodes/flymake.el: Bump package version and set emacs version in Package-Requires to 26.1 (Bug#53853). --- lisp/progmodes/flymake.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index e369cb1f21e..83d7bc8641c 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -4,9 +4,9 @@ ;; Author: Pavel Kobyakov ;; Maintainer: João Távora -;; Version: 1.2.1 +;; Version: 1.2.2 ;; Keywords: c languages tools -;; Package-Requires: ((emacs "28.1") (eldoc "1.1.0") (project "0.7.1")) +;; Package-Requires: ((emacs "26.1") (eldoc "1.1.0") (project "0.7.1")) ;; This is a GNU ELPA :core package. Avoid functionality that is not ;; compatible with the version of Emacs recorded above. From 69e82968d7c2b64710f6f6b79597ac98c82449e7 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Wed, 9 Feb 2022 17:38:10 +0100 Subject: [PATCH 2/2] Fix integer arithmetic miss-compilation (bug#53451) * lisp/emacs-lisp/comp-cstr.el (comp-cstr-set-range-for-arithm): When one of the two sources is negated revert to set dst as number. * test/src/comp-tests.el (comp-tests-type-spec-tests): Add test to verify this is effective. --- lisp/emacs-lisp/comp-cstr.el | 26 ++++++++++++++------------ test/src/comp-tests.el | 9 ++++++++- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index 97f8f4d5c40..65710b58c10 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -449,18 +449,20 @@ Return them as multiple value." (declare (debug (range-body)) (indent defun)) `(with-comp-cstr-accessors - (when-let ((r1 (range ,src1)) - (r2 (range ,src2))) - (let* ((l1 (comp-cstr-smallest-in-range r1)) - (l2 (comp-cstr-smallest-in-range r2)) - (h1 (comp-cstr-greatest-in-range r1)) - (h2 (comp-cstr-greatest-in-range r2))) - (setf (typeset ,dst) (when (cl-some (lambda (x) - (comp-subtype-p 'float x)) - (append (typeset src1) - (typeset src2))) - '(float)) - (range ,dst) ,@range-body))))) + (if (or (neg src1) (neg src2)) + (setf (typeset ,dst) '(number)) + (when-let ((r1 (range ,src1)) + (r2 (range ,src2))) + (let* ((l1 (comp-cstr-smallest-in-range r1)) + (l2 (comp-cstr-smallest-in-range r2)) + (h1 (comp-cstr-greatest-in-range r1)) + (h2 (comp-cstr-greatest-in-range r2))) + (setf (typeset ,dst) (when (cl-some (lambda (x) + (comp-subtype-p 'float x)) + (append (typeset src1) + (typeset src2))) + '(float)) + (range ,dst) ,@range-body)))))) (defun comp-cstr-add-2 (dst src1 src2) "Sum SRC1 and SRC2 into DST." diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index eb84262dc8e..96f2b42c0d7 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -1353,7 +1353,14 @@ Return a list of results." (when (eql x 1.0) (error "")) x) - t))) + t) + + ;; 74 + ((defun comp-tests-ret-type-spec-f (x) + (if (eq x 0) + (error "") + (1+ x))) + number))) (defun comp-tests-define-type-spec-test (number x) `(comp-deftest ,(intern (format "ret-type-spec-%d" number)) ()