diff options
author | Glenn Morris <rgm@gnu.org> | 2018-12-20 07:51:17 -0800 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2018-12-20 07:51:17 -0800 |
commit | 62112a77f191c0b00aa420ce2d0fee8aa03592bf (patch) | |
tree | 3f6f65f84d5f4a600534ae29aec1ef49fa797c4f | |
parent | 1e5f84805884e37563db9f16076d458ceaa03917 (diff) | |
parent | 081fb694c3f88e77d4a0e09fba8ce457037b9132 (diff) | |
download | emacs-62112a77f191c0b00aa420ce2d0fee8aa03592bf.tar.gz |
Merge from origin/emacs-26
081fb69 (origin/emacs-26) Check result from c-backward-token-2 to avo...
f4ea746 cl-make-random-state was not copying its arg
-rw-r--r-- | lisp/emacs-lisp/cl-extra.el | 2 | ||||
-rw-r--r-- | lisp/progmodes/cc-fonts.el | 4 | ||||
-rw-r--r-- | test/lisp/emacs-lisp/cl-extra-tests.el | 5 |
3 files changed, 8 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 78484fcfa3f..7d530deae5b 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -482,7 +482,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. diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 2e85924f7be..e91e54df9ca 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -1255,8 +1255,8 @@ casts and declarations are fontified. Used on level 2 and higher." (save-excursion (goto-char match-pos) (while - (progn (c-backward-token-2) - (eq (char-after) ?\())) + (and (zerop (c-backward-token-2)) + (eq (char-after) ?\())) (looking-at c-arithmetic-op-regexp))) (cons nil nil)) ;; In a C++ member initialization list. diff --git a/test/lisp/emacs-lisp/cl-extra-tests.el b/test/lisp/emacs-lisp/cl-extra-tests.el index baad8eb8e67..fe59703530f 100644 --- a/test/lisp/emacs-lisp/cl-extra-tests.el +++ b/test/lisp/emacs-lisp/cl-extra-tests.el @@ -94,4 +94,9 @@ (should (equal (list lst3 (cdr lst3) (cddr lst3)) (cl-maplist fn3 lst lst2 lst3))))) +(ert-deftest cl-extra-test-cl-make-random-state () + (let ((s (cl-make-random-state))) + ;; Test for Bug#33731. + (should-not (eq s (cl-make-random-state s))))) + ;;; cl-extra-tests.el ends here |