aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2013-06-30 18:03:31 +0300
committerEli Zaretskii2013-06-30 18:03:31 +0300
commit5d1c328614c3b8165ee3c9e9d3597f1fb0196ede (patch)
tree87f6910dc8ee30bc6c7dd0be3cc760a0f4dc5e48 /src
parent0ba54312c98bdcc8ab3ffc872cb9581710a0eea8 (diff)
downloademacs-5d1c328614c3b8165ee3c9e9d3597f1fb0196ede.tar.gz
emacs-5d1c328614c3b8165ee3c9e9d3597f1fb0196ede.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/intervals.c8
2 files changed, 5 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f10e1070fa3..753f0b9826d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12013-06-30 Eli Zaretskii <eliz@gnu.org> 12013-06-30 Eli Zaretskii <eliz@gnu.org>
2 2
3 * intervals.c (get_local_map): Instead of aborting, clip POSITION
4 to the valid range of values. (Bug#14753)
5
3 * xdisp.c (Fmove_point_visually): Invalidate the cursor position 6 * xdisp.c (Fmove_point_visually): Invalidate the cursor position
4 when moving point by using the current glyph matrix. This avoids 7 when moving point by using the current glyph matrix. This avoids
5 the need to force redisplay when this function is called in a 8 the need to force redisplay when this function is called in a
diff --git a/src/intervals.c b/src/intervals.c
index f65ce0ecc77..0b3bcc6ef4e 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -2196,9 +2196,7 @@ get_property_and_range (ptrdiff_t pos, Lisp_Object prop, Lisp_Object *val,
2196/* Return the proper local keymap TYPE for position POSITION in 2196/* Return the proper local keymap TYPE for position POSITION in
2197 BUFFER; TYPE should be one of `keymap' or `local-map'. Use the map 2197 BUFFER; TYPE should be one of `keymap' or `local-map'. Use the map
2198 specified by the PROP property, if any. Otherwise, if TYPE is 2198 specified by the PROP property, if any. Otherwise, if TYPE is
2199 `local-map' use BUFFER's local map. 2199 `local-map' use BUFFER's local map. */
2200
2201 POSITION must be in the accessible part of BUFFER. */
2202 2200
2203Lisp_Object 2201Lisp_Object
2204get_local_map (register ptrdiff_t position, register struct buffer *buffer, 2202get_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 Lisp_Object prop, lispy_position, lispy_buffer; 2205 Lisp_Object prop, lispy_position, lispy_buffer;
2208 ptrdiff_t old_begv, old_zv, old_begv_byte, old_zv_byte; 2206 ptrdiff_t old_begv, old_zv, old_begv_byte, old_zv_byte;
2209 2207
2210 /* Perhaps we should just change `position' to the limit. */ 2208 clip_to_bounds (BUF_BEGV (buffer), position, BUF_ZV (buffer));
2211 if (position > BUF_ZV (buffer) || position < BUF_BEGV (buffer))
2212 emacs_abort ();
2213 2209
2214 /* Ignore narrowing, so that a local map continues to be valid even if 2210 /* Ignore narrowing, so that a local map continues to be valid even if
2215 the visible region contains no characters and hence no properties. */ 2211 the visible region contains no characters and hence no properties. */