(neg dst) (not (neg src)))
dst))
+(defun comp-cstr-value-negation (dst src)
+ "Negate values in SRC setting the result in DST.
+DST is returned."
+ (with-comp-cstr-accessors
+ (if (or (valset src) (range src))
+ (setf (typeset dst) ()
+ (valset dst) (valset src)
+ (range dst) (range src)
+ (neg dst) (not (neg src)))
+ (setf (typeset dst) (typeset src)
+ (valset dst) ()
+ (range dst) ()))
+ dst))
+
(defun comp-cstr-negation-make (src)
"Negate SRC and return a new constraint."
(comp-cstr-negation (make-comp-cstr) src))
(not
;; Prevent double negation!
(unless (comp-cstr-neg (car operands))
- (comp-cstr-negation lval (car operands))))))
+ (comp-cstr-value-negation lval (car operands))))))
(`(setimm ,lval ,v)
(setf (comp-mvar-value lval) v))
(`(phi ,lval . ,rest)
(setq args (cons (substring arg start pos) args))))
args))
-(defun comp-test-45376-f ()
+(defun comp-test-45376-1-f ()
;; Reduced from `eshell-ls-find-column-lengths'.
(let* (res
(len 2)
i (1+ i)))
res))
+(defun comp-test-45376-2-f ()
+ ;; Also reduced from `eshell-ls-find-column-lengths'.
+ (let* ((x 1)
+ res)
+ (while x
+ (let* ((y 4)
+ (i 0))
+ (while (> y 0)
+ (when (= i x)
+ (setq i 0))
+ (setf res (cons i res))
+ (setq y (1- y)
+ i (1+ i)))
+ (if (>= x 3)
+ (setq x nil)
+ (setq x (1+ x)))))
+ res))
+
\f
;;;;;;;;;;;;;;;;;;;;
;; Tromey's tests ;;
"Broken call args assumptions lead to infinite loop."
(should (equal (comp-test-assume-in-loop-1-f "cd") '("cd"))))
-(comp-deftest bug-45376 ()
+(comp-deftest bug-45376-1 ()
"<https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-12/msg01883.html>"
- (should (equal (comp-test-45376-f) '(1 0))))
+ (should (equal (comp-test-45376-1-f) '(1 0))))
+
+(comp-deftest bug-45376-2 ()
+ "<https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-12/msg01883.html>"
+ (should (equal (comp-test-45376-2-f) '(0 2 1 0 1 0 1 0 0 0 0 0))))
(defvar comp-test-primitive-advice)
(comp-deftest primitive-advice ()