From: Andrea Corallo Date: Thu, 12 Nov 2020 22:38:01 +0000 (+0100) Subject: * lisp/emacs-lisp/comp.el (comp-mvar-value-vld-p): Fix logic. X-Git-Tag: emacs-28.0.90~2727^2~326 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c412d396b0e714c604b3386369b64f0c7e762fe8;p=emacs.git * lisp/emacs-lisp/comp.el (comp-mvar-value-vld-p): Fix logic. --- diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 583a3364dfa..217eec1b568 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -456,15 +456,21 @@ Interg values are handled in the `range' slot.") (defun comp-mvar-value-vld-p (mvar) "Return t if one single value can be extracted by the MVAR constrains." - (or (= (length (comp-mvar-valset mvar)) 1) - (let ((r (comp-mvar-range mvar))) - (and (= (length r) 1) - (let ((low (caar r)) - (high (cdar r))) - (and - (integerp low) - (integerp high) - (= low high))))))) + (when (null (comp-mvar-typeset mvar)) + (let* ((v (comp-mvar-valset mvar)) + (r (comp-mvar-range mvar)) + (valset-len (length v)) + (range-len (length r))) + (if (and (= valset-len 1) + (= range-len 0)) + t + (when (and (= valset-len 0) + (= range-len 1)) + (let* ((low (caar r)) + (high (cdar r))) + (and (integerp low) + (integerp high) + (= low high)))))))) (defun comp-mvar-value (mvar) "Return the constant value of MVAR.