1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-23 04:53:12 -08:00

(tool_bar_item_info): Avoid calling Fget_text_property

with invalid position.
This commit is contained in:
Gerd Moellmann 2001-11-17 10:48:51 +00:00
parent 7e921f65b4
commit 44016144fd
2 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2001-11-17 Gerd Moellmann <gerd@gnu.org>
* xdisp.c (tool_bar_item_info): Avoid calling Fget_text_property
with invalid position.
2001-11-16 Eli Zaretskii <eliz@is.elta.co.il>
* syswait.h (HAVE_SYS_WAIT_H): Undef for ISC 4.1. Reported by

View file

@ -7945,11 +7945,18 @@ tool_bar_item_info (f, glyph, prop_idx)
{
Lisp_Object prop;
int success_p;
int charpos;
/* This function can be called asynchronously, which means we must
exclude any possibility that Fget_text_property signals an
error. */
charpos = min (XSTRING (f->current_tool_bar_string)->size, glyph->charpos);
charpos = max (0, charpos);
/* Get the text property `menu-item' at pos. The value of that
property is the start index of this item's properties in
F->tool_bar_items. */
prop = Fget_text_property (make_number (glyph->charpos),
prop = Fget_text_property (make_number (charpos),
Qmenu_item, f->current_tool_bar_string);
if (INTEGERP (prop))
{