From: Eli Zaretskii Date: Fri, 22 Nov 2013 16:04:49 +0000 (+0200) Subject: Fix bug #15951 with vertical-motion near beginning of narrowed region. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~741 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cd88d68262e85e3f57f6847f916d6ea901d5e8f0;p=emacs.git Fix bug #15951 with vertical-motion near beginning of narrowed region. src/bidi.c (bidi_find_paragraph_start): Limit the returned positions to BEGV_BYTE..ZV_BYTE range. --- diff --git a/src/ChangeLog b/src/ChangeLog index 769b4ca6e64..994ea2d3de5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-11-22 Eli Zaretskii + + * bidi.c (bidi_find_paragraph_start): Limit the returned positions + to BEGV_BYTE..ZV_BYTE range. (Bug#15951) + 2013-11-21 Paul Eggert Fix some dependency problems that cause unnecessary recompiles. diff --git a/src/bidi.c b/src/bidi.c index dc905cd9e5f..98c3c17b78f 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -1148,6 +1148,9 @@ bidi_find_paragraph_start (ptrdiff_t pos, ptrdiff_t pos_byte) pos = BEGV, pos_byte = BEGV_BYTE; if (bpc) know_region_cache (current_buffer, bpc, pos, oldpos); + /* Positions returned by the region cache are not limited to + BEGV..ZV range, so we limit them here. */ + pos_byte = clip_to_bounds (BEGV_BYTE, pos_byte, ZV_BYTE); return pos_byte; }