diff options
| author | Gerd Moellmann | 2001-11-17 10:46:45 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-11-17 10:46:45 +0000 |
| commit | be67609465d2eeab2f51e6403f5d6ae1395669ca (patch) | |
| tree | df9ceecb472aa11706ff1b47c79b8d12848a4289 /src | |
| parent | 9f8bbf0f0db0d88b8e9c5b83385e7bd4df76a040 (diff) | |
| download | emacs-be67609465d2eeab2f51e6403f5d6ae1395669ca.tar.gz emacs-be67609465d2eeab2f51e6403f5d6ae1395669ca.zip | |
(tool_bar_item_info): Avoid calling Fget_text_property
with invalid position.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/xdisp.c | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index dcd69d8744d..90f8929bbcc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2001-11-17 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (tool_bar_item_info): Avoid calling Fget_text_property | ||
| 4 | with invalid position. | ||
| 5 | |||
| 1 | 2001-11-16 Richard M. Stallman <rms@gnu.org> | 6 | 2001-11-16 Richard M. Stallman <rms@gnu.org> |
| 2 | 7 | ||
| 3 | * syswait.h: Delete conditionals for HPUX7, ISC 4.1, and convex. | 8 | * syswait.h: Delete conditionals for HPUX7, ISC 4.1, and convex. |
diff --git a/src/xdisp.c b/src/xdisp.c index 0922084f560..332c11c974e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -7935,11 +7935,18 @@ tool_bar_item_info (f, glyph, prop_idx) | |||
| 7935 | { | 7935 | { |
| 7936 | Lisp_Object prop; | 7936 | Lisp_Object prop; |
| 7937 | int success_p; | 7937 | int success_p; |
| 7938 | int charpos; | ||
| 7939 | |||
| 7940 | /* This function can be called asynchronously, which means we must | ||
| 7941 | exclude any possibility that Fget_text_property signals an | ||
| 7942 | error. */ | ||
| 7943 | charpos = min (XSTRING (f->current_tool_bar_string)->size, glyph->charpos); | ||
| 7944 | charpos = max (0, charpos); | ||
| 7938 | 7945 | ||
| 7939 | /* Get the text property `menu-item' at pos. The value of that | 7946 | /* Get the text property `menu-item' at pos. The value of that |
| 7940 | property is the start index of this item's properties in | 7947 | property is the start index of this item's properties in |
| 7941 | F->tool_bar_items. */ | 7948 | F->tool_bar_items. */ |
| 7942 | prop = Fget_text_property (make_number (glyph->charpos), | 7949 | prop = Fget_text_property (make_number (charpos), |
| 7943 | Qmenu_item, f->current_tool_bar_string); | 7950 | Qmenu_item, f->current_tool_bar_string); |
| 7944 | if (INTEGERP (prop)) | 7951 | if (INTEGERP (prop)) |
| 7945 | { | 7952 | { |