aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAndrea Corallo2020-12-23 10:46:33 +0100
committerAndrea Corallo2020-12-23 10:58:42 +0100
commitfd8dd75a71eef796ba8fb1d2604fd615bebaae42 (patch)
treea1d0e3d81d71e18fee0baa768719d56b2a922ac9 /test
parent2a22fa8b68d18b83b0a20be66b9123454bf7b6e5 (diff)
downloademacs-fd8dd75a71eef796ba8fb1d2604fd615bebaae42.tar.gz
emacs-fd8dd75a71eef796ba8fb1d2604fd615bebaae42.zip
Make input constraints into memoization hash immutable (bug#45376)
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1) (comp-cstr-intersection): Copy input before soting it into the memoization hash table.
Diffstat (limited to 'test')
-rw-r--r--test/src/comp-test-funcs.el14
-rw-r--r--test/src/comp-tests.el4
2 files changed, 18 insertions, 0 deletions
diff --git a/test/src/comp-test-funcs.el b/test/src/comp-test-funcs.el
index a2663eaf9cf..d6bcfca2d94 100644
--- a/test/src/comp-test-funcs.el
+++ b/test/src/comp-test-funcs.el
@@ -417,6 +417,20 @@
417 (setq args (cons (substring arg start pos) args)))) 417 (setq args (cons (substring arg start pos) args))))
418 args)) 418 args))
419 419
420(defun comp-test-45376-f ()
421 ;; Reduced from `eshell-ls-find-column-lengths'.
422 (let* (res
423 (len 2)
424 (i 0)
425 (j 0))
426 (while (< j len)
427 (if (= i len)
428 (setq i 0))
429 (setq res (cons i res)
430 j (1+ j)
431 i (1+ i)))
432 res))
433
420 434
421;;;;;;;;;;;;;;;;;;;; 435;;;;;;;;;;;;;;;;;;;;
422;; Tromey's tests ;; 436;; Tromey's tests ;;
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index 0594a4e086c..5f2d702fca0 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -409,6 +409,10 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html."
409 "Broken call args assumptions lead to infinite loop." 409 "Broken call args assumptions lead to infinite loop."
410 (should (equal (comp-test-assume-in-loop-1-f "cd") '("cd")))) 410 (should (equal (comp-test-assume-in-loop-1-f "cd") '("cd"))))
411 411
412(comp-deftest bug-45376 ()
413 "<https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-12/msg01883.html>"
414 (should (equal (comp-test-45376-f) '(1 0))))
415
412(defvar comp-test-primitive-advice) 416(defvar comp-test-primitive-advice)
413(comp-deftest primitive-advice () 417(comp-deftest primitive-advice ()
414 "Test effectiveness of primitive advicing." 418 "Test effectiveness of primitive advicing."