]> git.eshelyaron.com Git - emacs.git/commitdiff
Add some more error checking code to `x_stop_ignoring_errors'
authorPo Lu <luangruo@yahoo.com>
Mon, 4 Jul 2022 01:33:19 +0000 (09:33 +0800)
committerPo Lu <luangruo@yahoo.com>
Mon, 4 Jul 2022 01:33:19 +0000 (09:33 +0800)
* src/xterm.c (x_stop_ignoring_errors): Abort if no request was
actually made, making the state inconsistent.

src/xterm.c

index dc7e3283a5c9f7bac2b5b6ebd9fdee0a70343ae4..02ea968031e7c248985383b036b3eded6005d4f5 100644 (file)
@@ -23139,6 +23139,13 @@ x_stop_ignoring_errors (struct x_display_info *dpyinfo)
 
   range = dpyinfo->next_failable_request - 1;
   range->end = XNextRequest (dpyinfo->display) - 1;
+
+  /* Abort if no request was made since
+     `x_ignore_errors_for_next_request'.  */
+
+  if (X_COMPARE_SERIALS (range->end, <,
+                        range->start))
+    emacs_abort ();
 }
 
 /* Undo the last x_catch_errors call.