From 0c5b39ec6cd3c9a85b99921ad747a7119eb28b28 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 26 Jan 2025 22:15:49 -0800 Subject: [PATCH] Fix x-show-tip bignum crash * 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 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pgtkfns.c b/src/pgtkfns.c index 21456f4f489..2c87ba8e326 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c @@ -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 */ -- 2.39.5