Mercurial > emacs
changeset 41194:e0f2d5ffc822
(tool_bar_item_info): Avoid calling Fget_text_property
with invalid position.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Sat, 17 Nov 2001 10:46:24 +0000 |
parents | 1377d461b09c |
children | 352661c2b24c |
files | src/xdisp.c |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xdisp.c Sat Nov 17 09:38:14 2001 +0000 +++ b/src/xdisp.c Sat Nov 17 10:46:24 2001 +0000 @@ -7935,11 +7935,18 @@ { 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)) {