cl-make-random-state was not copying its arg
Problem reported by Xu Chunyang (Bug#33731). * lisp/emacs-lisp/cl-extra.el (cl-make-random-state): Use copy-sequence, not copy-tree, so that the record is copied. * test/lisp/emacs-lisp/cl-extra-tests.el: (cl-extra-test-cl-make-random-state): New test.
This commit is contained in:
parent
fda43a7bef
commit
f4ea746451
2 changed files with 6 additions and 1 deletions
|
@ -484,7 +484,7 @@ Optional second arg STATE is a random-state object."
|
|||
If STATE is t, return a new state object seeded from the time of day."
|
||||
(unless state (setq state cl--random-state))
|
||||
(if (cl-random-state-p state)
|
||||
(copy-tree state t)
|
||||
(copy-sequence state)
|
||||
(cl--make-random-state (if (integerp state) state (cl--random-time)))))
|
||||
|
||||
;; Implementation limits.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue