emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r113231: A possible fix for bug #14753 with aborts i


From: Eli Zaretskii
Subject: [Emacs-diffs] trunk r113231: A possible fix for bug #14753 with aborts in get_local_map.
Date: Sun, 30 Jun 2013 15:04:06 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113231
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/14753
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sun 2013-06-30 18:03:31 +0300
message:
  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.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/intervals.c                intervals.c-20091113204419-o5vbwnq5f7feedwu-519
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-06-30 14:49:33 +0000
+++ b/src/ChangeLog     2013-06-30 15:03:31 +0000
@@ -1,5 +1,8 @@
 2013-06-30  Eli Zaretskii  <address@hidden>
 
+       * 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
        when moving point by using the current glyph matrix.  This avoids
        the need to force redisplay when this function is called in a

=== modified file 'src/intervals.c'
--- a/src/intervals.c   2013-03-24 12:59:45 +0000
+++ b/src/intervals.c   2013-06-30 15:03:31 +0000
@@ -2196,9 +2196,7 @@
 /* Return the proper local keymap TYPE for position POSITION in
    BUFFER; TYPE should be one of `keymap' or `local-map'.  Use the map
    specified by the PROP property, if any.  Otherwise, if TYPE is
-   `local-map' use BUFFER's local map.
-
-   POSITION must be in the accessible part of BUFFER.  */
+   `local-map' use BUFFER's local map.  */
 
 Lisp_Object
 get_local_map (register ptrdiff_t position, register struct buffer *buffer,
@@ -2207,9 +2205,7 @@
   Lisp_Object prop, lispy_position, lispy_buffer;
   ptrdiff_t old_begv, old_zv, old_begv_byte, old_zv_byte;
 
-  /* Perhaps we should just change `position' to the limit.  */
-  if (position > BUF_ZV (buffer) || position < BUF_BEGV (buffer))
-    emacs_abort ();
+  clip_to_bounds (BUF_BEGV (buffer), position, BUF_ZV (buffer));
 
   /* Ignore narrowing, so that a local map continues to be valid even if
      the visible region contains no characters and hence no properties.  */


reply via email to

[Prev in Thread] Current Thread [Next in Thread]