Commit 5d1c3286 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

A possible fix for bug #14753 with aborts in get_local_map.

 src/intervals.c (get_local_map): Instead of aborting, clip POSITION
 to the valid range of values.
parent 0ba54312
2013-06-30 Eli Zaretskii <eliz@gnu.org> 2013-06-30 Eli Zaretskii <eliz@gnu.org>
* intervals.c (get_local_map): Instead of aborting, clip POSITION
to the valid range of values. (Bug#14753)
* xdisp.c (Fmove_point_visually): Invalidate the cursor position * xdisp.c (Fmove_point_visually): Invalidate the cursor position
when moving point by using the current glyph matrix. This avoids when moving point by using the current glyph matrix. This avoids
the need to force redisplay when this function is called in a the need to force redisplay when this function is called in a
......
...@@ -2196,9 +2196,7 @@ get_property_and_range (ptrdiff_t pos, Lisp_Object prop, Lisp_Object *val, ...@@ -2196,9 +2196,7 @@ get_property_and_range (ptrdiff_t pos, Lisp_Object prop, Lisp_Object *val,
/* Return the proper local keymap TYPE for position POSITION in /* Return the proper local keymap TYPE for position POSITION in
BUFFER; TYPE should be one of `keymap' or `local-map'. Use the map BUFFER; TYPE should be one of `keymap' or `local-map'. Use the map
specified by the PROP property, if any. Otherwise, if TYPE is specified by the PROP property, if any. Otherwise, if TYPE is
`local-map' use BUFFER's local map. `local-map' use BUFFER's local map. */
POSITION must be in the accessible part of BUFFER. */
Lisp_Object Lisp_Object
get_local_map (register ptrdiff_t position, register struct buffer *buffer, get_local_map (register ptrdiff_t position, register struct buffer *buffer,
...@@ -2207,9 +2205,7 @@ get_local_map (register ptrdiff_t position, register struct buffer *buffer, ...@@ -2207,9 +2205,7 @@ get_local_map (register ptrdiff_t position, register struct buffer *buffer,
Lisp_Object prop, lispy_position, lispy_buffer; Lisp_Object prop, lispy_position, lispy_buffer;
ptrdiff_t old_begv, old_zv, old_begv_byte, old_zv_byte; ptrdiff_t old_begv, old_zv, old_begv_byte, old_zv_byte;
/* Perhaps we should just change `position' to the limit. */ clip_to_bounds (BUF_BEGV (buffer), position, BUF_ZV (buffer));
if (position > BUF_ZV (buffer) || position < BUF_BEGV (buffer))
emacs_abort ();
/* Ignore narrowing, so that a local map continues to be valid even if /* Ignore narrowing, so that a local map continues to be valid even if
the visible region contains no characters and hence no properties. */ the visible region contains no characters and hence no properties. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment