aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2020-07-07 07:50:39 -0700
committerGlenn Morris2020-07-07 07:50:39 -0700
commit3b36b38713aefb3aba40b3c094246782e8893f80 (patch)
tree07fa2065252c6cfbe9dc266cfd043071921e321f
parent6b80ff3c465f87a31ccaaf41b2b521075f43632d (diff)
parent59e768d64ad97782249fda9e53b6adc94c6d0130 (diff)
downloademacs-3b36b38713aefb3aba40b3c094246782e8893f80.tar.gz
emacs-3b36b38713aefb3aba40b3c094246782e8893f80.zip
Merge from origin/emacs-27
59e768d64a Fix undefined behavior in json.c (Bug#42113) cce00bef03 Fix ACTION argument of 'display-buffer' call in gud.el 0121db2702 * src/keyboard.c (Fclear_this_command_keys): Doc fix. b9abf5ceb2 Improve do string of 'man' b87fc938a0 ; * src/xdisp.c (pos_visible_p): Yet another minor fix for...
-rw-r--r--lisp/man.el6
-rw-r--r--lisp/progmodes/gud.el6
-rw-r--r--src/json.c2
-rw-r--r--src/keyboard.c2
-rw-r--r--src/xdisp.c11
-rw-r--r--test/src/json-tests.el12
6 files changed, 30 insertions, 9 deletions
diff --git a/lisp/man.el b/lisp/man.el
index 5278a1a84dd..8a36f3ac25d 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -996,7 +996,11 @@ An \"apropos\" query with -k gives a buffer of matching page
996names or descriptions. The pattern argument is usually an 996names or descriptions. The pattern argument is usually an
997\"grep -E\" style regexp. 997\"grep -E\" style regexp.
998 998
999 -k pattern" 999 -k pattern
1000
1001Note that in some cases you will need to use \\[quoted-insert] to quote the
1002SPC character in the above examples, because this command attempts
1003to auto-complete your input based on the installed manual pages."
1000 1004
1001 (interactive 1005 (interactive
1002 (list (let* ((default-entry (Man-default-man-entry)) 1006 (list (let* ((default-entry (Man-default-man-entry))
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index eb43e8b7e44..092d15983e5 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -2620,9 +2620,9 @@ comint mode, which see."
2620 (select-window 2620 (select-window
2621 (display-buffer 2621 (display-buffer
2622 (get-buffer-create (concat "*gud" filepart "*")) 2622 (get-buffer-create (concat "*gud" filepart "*"))
2623 '(display-buffer-reuse-window 2623 '((display-buffer-reuse-window
2624 display-buffer-in-previous-window 2624 display-buffer-in-previous-window
2625 display-buffer-same-window display-buffer-pop-up-window))) 2625 display-buffer-same-window display-buffer-pop-up-window))))
2626 (when (and existing-buffer (get-buffer-process existing-buffer)) 2626 (when (and existing-buffer (get-buffer-process existing-buffer))
2627 (error "This program is already being debugged")) 2627 (error "This program is already being debugged"))
2628 ;; Set the dir, in case the buffer already existed with a different dir. 2628 ;; Set the dir, in case the buffer already existed with a different dir.
diff --git a/src/json.c b/src/json.c
index 30027675580..814afc6d741 100644
--- a/src/json.c
+++ b/src/json.c
@@ -365,6 +365,7 @@ lisp_to_json_toplevel_1 (Lisp_Object lisp,
365 Lisp_Object key = HASH_KEY (h, i); 365 Lisp_Object key = HASH_KEY (h, i);
366 if (!EQ (key, Qunbound)) 366 if (!EQ (key, Qunbound))
367 { 367 {
368 CHECK_STRING (key);
368 Lisp_Object ekey = json_encode (key); 369 Lisp_Object ekey = json_encode (key);
369 /* We can't specify the length, so the string must be 370 /* We can't specify the length, so the string must be
370 NUL-terminated. */ 371 NUL-terminated. */
@@ -975,6 +976,7 @@ usage: (json-parse-string STRING &rest ARGS) */)
975#endif 976#endif
976 977
977 Lisp_Object string = args[0]; 978 Lisp_Object string = args[0];
979 CHECK_STRING (string);
978 Lisp_Object encoded = json_encode (string); 980 Lisp_Object encoded = json_encode (string);
979 check_string_without_embedded_nuls (encoded); 981 check_string_without_embedded_nuls (encoded);
980 struct json_configuration conf = 982 struct json_configuration conf =
diff --git a/src/keyboard.c b/src/keyboard.c
index f9b9399d502..5fa58abce1d 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -10531,7 +10531,7 @@ The value is always a vector. */)
10531DEFUN ("clear-this-command-keys", Fclear_this_command_keys, 10531DEFUN ("clear-this-command-keys", Fclear_this_command_keys,
10532 Sclear_this_command_keys, 0, 1, 0, 10532 Sclear_this_command_keys, 0, 1, 0,
10533 doc: /* Clear out the vector that `this-command-keys' returns. 10533 doc: /* Clear out the vector that `this-command-keys' returns.
10534Also clear the record of the last 100 events, unless optional arg 10534Also clear the record of the last 300 input events, unless optional arg
10535KEEP-RECORD is non-nil. */) 10535KEEP-RECORD is non-nil. */)
10536 (Lisp_Object keep_record) 10536 (Lisp_Object keep_record)
10537{ 10537{
diff --git a/src/xdisp.c b/src/xdisp.c
index e454fd7b83f..92afcccd388 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1872,10 +1872,13 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
1872 /* Account for line-number display, if IT3 still 1872 /* Account for line-number display, if IT3 still
1873 didn't. This can happen if START - 1 is the 1873 didn't. This can happen if START - 1 is the
1874 first or the last character on its display line. */ 1874 first or the last character on its display line. */
1875 if (it3.lnum_pixel_width > 0) 1875 if (!it3.line_number_produced_p)
1876 top_x += it3.lnum_pixel_width; 1876 {
1877 else if (it.line_number_produced_p) 1877 if (it3.lnum_pixel_width > 0)
1878 top_x += it.lnum_pixel_width; 1878 top_x += it3.lnum_pixel_width;
1879 else if (it.line_number_produced_p)
1880 top_x += it.lnum_pixel_width;
1881 }
1879 /* Normally, we would exit the above loop because we 1882 /* Normally, we would exit the above loop because we
1880 found the display element whose character 1883 found the display element whose character
1881 position is CHARPOS. For the contingency that we 1884 position is CHARPOS. For the contingency that we
diff --git a/test/src/json-tests.el b/test/src/json-tests.el
index 7eeef885198..028f92f29d3 100644
--- a/test/src/json-tests.el
+++ b/test/src/json-tests.el
@@ -296,5 +296,17 @@ Test with both unibyte and multibyte strings."
296 (1+ most-positive-fixnum) 296 (1+ most-positive-fixnum)
297 (1- most-negative-fixnum))))) 297 (1- most-negative-fixnum)))))
298 298
299(ert-deftest json-parse-string/wrong-type ()
300 "Check that Bug#42113 is fixed."
301 (skip-unless (fboundp 'json-parse-string))
302 (should-error (json-parse-string 1) :type 'wrong-type-argument))
303
304(ert-deftest json-serialize/wrong-hash-key-type ()
305 "Check that Bug#42113 is fixed."
306 (skip-unless (fboundp 'json-serialize))
307 (let ((table (make-hash-table :test #'eq)))
308 (puthash 1 2 table)
309 (should-error (json-serialize table) :type 'wrong-type-argument)))
310
299(provide 'json-tests) 311(provide 'json-tests)
300;;; json-tests.el ends here 312;;; json-tests.el ends here