]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix x-show-tip bignum crash
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 27 Jan 2025 06:15:49 +0000 (22:15 -0800)
committerEshel Yaron <me@eshelyaron.com>
Thu, 30 Jan 2025 18:06:29 +0000 (19:06 +0100)
* src/pgtkfns.c (compute_tip_xy): Fix crash if user specifies
bignums.  Bug found with --enable-gcc-warnings.

(cherry picked from commit 17a8bf53f390718756e397cc0b31c1ef2c7de5f0)

src/pgtkfns.c

index 21456f4f489798a9c07ec18332ccaf57ab9feb3e..2c87ba8e3268b6e6f5be66ffc45104fbbd772736 100644 (file)
@@ -2905,8 +2905,8 @@ compute_tip_xy (struct frame *f, Lisp_Object parms, Lisp_Object dx,
 
   /* Move the tooltip window where the mouse pointer is.  Resize and
      show it.  */
-  if ((!INTEGERP (left) && !INTEGERP (right))
-      || (!INTEGERP (top) && !INTEGERP (bottom)))
+  if ((!FIXNUMP (left) && !FIXNUMP (right))
+      || (!FIXNUMP (top) && !FIXNUMP (bottom)))
     {
       Lisp_Object frame, attributes, monitor, geometry;
       GdkSeat *seat =
@@ -2955,9 +2955,9 @@ compute_tip_xy (struct frame *f, Lisp_Object parms, Lisp_Object dx,
       max_y = pgtk_display_pixel_height (FRAME_DISPLAY_INFO (f));
     }
 
-  if (INTEGERP (top))
+  if (FIXNUMP (top))
     *root_y = XFIXNUM (top);
-  else if (INTEGERP (bottom))
+  else if (FIXNUMP (bottom))
     *root_y = XFIXNUM (bottom) - height;
   else if (*root_y + XFIXNUM (dy) <= min_y)
     *root_y = min_y;           /* Can happen for negative dy */
@@ -2971,9 +2971,9 @@ compute_tip_xy (struct frame *f, Lisp_Object parms, Lisp_Object dx,
     /* Put it on the top.  */
     *root_y = min_y;
 
-  if (INTEGERP (left))
+  if (FIXNUMP (left))
     *root_x = XFIXNUM (left);
-  else if (INTEGERP (right))
+  else if (FIXNUMP (right))
     *root_x = XFIXNUM (right) - width;
   else if (*root_x + XFIXNUM (dx) <= min_x)
     *root_x = 0;               /* Can happen for negative dx */