* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1)
(comp-cstr-intersection): Copy input before soting it into the
memoization hash table.
(comp-cstr-ctxt-union-1-mem-no-range comp-ctxt)))
(res (or (gethash srcs mem-h)
(puthash
- srcs
+ (mapcar #'comp-cstr-copy srcs)
(apply #'comp-cstr-union-1-no-mem range srcs)
mem-h))))
(setf (typeset dst) (typeset res)
(let* ((mem-h (comp-cstr-ctxt-intersection-mem comp-ctxt))
(res (or (gethash srcs mem-h)
(puthash
- srcs
+ (mapcar #'comp-cstr-copy srcs)
(apply #'comp-cstr-intersection-no-mem srcs)
mem-h))))
(setf (typeset dst) (typeset res)
(setq args (cons (substring arg start pos) args))))
args))
+(defun comp-test-45376-f ()
+ ;; Reduced from `eshell-ls-find-column-lengths'.
+ (let* (res
+ (len 2)
+ (i 0)
+ (j 0))
+ (while (< j len)
+ (if (= i len)
+ (setq i 0))
+ (setq res (cons i res)
+ j (1+ j)
+ i (1+ i)))
+ 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 ()
+ "<https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-12/msg01883.html>"
+ (should (equal (comp-test-45376-f) '(1 0))))
+
(defvar comp-test-primitive-advice)
(comp-deftest primitive-advice ()
"Test effectiveness of primitive advicing."