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.
This commit is contained in:
Andrea Corallo 2020-12-23 10:46:33 +01:00
parent 2a22fa8b68
commit fd8dd75a71
3 changed files with 20 additions and 2 deletions

View file

@ -507,7 +507,7 @@ DST is returned."
(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)
@ -676,7 +676,7 @@ DST is returned."
(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)