aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2010-04-03 16:43:23 +0300
committerEli Zaretskii2010-04-03 16:43:23 +0300
commit1502b819370b4194a3050702229ca3d239700e02 (patch)
tree1a8890d155b3e5d8d80da0e8ec55e3ba6e5c491a /src
parent83d02defcee08fdd17b15d69766a4dbe40112da8 (diff)
downloademacs-1502b819370b4194a3050702229ca3d239700e02.tar.gz
emacs-1502b819370b4194a3050702229ca3d239700e02.zip
Fix infloop in bidi buffers with vertical cursor motion at ZV.
bidi.c (bidi_resolve_explicit, bidi_level_of_next_char): Check bidi_it->bytepos against ZV_BYTE instead of bidi_it->ch against BIDI_EOB.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/bidi.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 50e12560b91..6629a29ed9e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
12010-04-03 Eli Zaretskii <eliz@gnu.org> 12010-04-03 Eli Zaretskii <eliz@gnu.org>
2 2
3 * bidi.c (bidi_resolve_explicit, bidi_level_of_next_char): Check
4 bidi_it->bytepos against ZV_BYTE instead of bidi_it->ch against
5 BIDI_EOB. Fixes infloop with vertical cursor motion at ZV.
6
3 * w32fns.c (x_create_tip_frame): Copy `parms' before we modify it 7 * w32fns.c (x_create_tip_frame): Copy `parms' before we modify it
4 in this function. (Bug#5703) 8 in this function. (Bug#5703)
5 9
diff --git a/src/bidi.c b/src/bidi.c
index ea47cd33fec..7da8cd4a88c 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -1242,7 +1242,7 @@ bidi_resolve_explicit (struct bidi_it *bidi_it)
1242 if (prev_level < new_level 1242 if (prev_level < new_level
1243 && bidi_it->type == WEAK_BN 1243 && bidi_it->type == WEAK_BN
1244 && bidi_it->ignore_bn_limit == 0 /* only if not already known */ 1244 && bidi_it->ignore_bn_limit == 0 /* only if not already known */
1245 && bidi_it->ch != BIDI_EOB /* not already at EOB */ 1245 && bidi_it->bytepos < ZV_BYTE /* not already at EOB */
1246 && bidi_explicit_dir_char (FETCH_CHAR (bidi_it->bytepos 1246 && bidi_explicit_dir_char (FETCH_CHAR (bidi_it->bytepos
1247 + bidi_it->ch_len))) 1247 + bidi_it->ch_len)))
1248 { 1248 {
@@ -1648,7 +1648,7 @@ bidi_level_of_next_char (struct bidi_it *bidi_it)
1648 if (bidi_it->scan_dir == 1) 1648 if (bidi_it->scan_dir == 1)
1649 { 1649 {
1650 /* There's no sense in trying to advance if we hit end of text. */ 1650 /* There's no sense in trying to advance if we hit end of text. */
1651 if (bidi_it->ch == BIDI_EOB) 1651 if (bidi_it->bytepos >= ZV_BYTE)
1652 return bidi_it->resolved_level; 1652 return bidi_it->resolved_level;
1653 1653
1654 /* Record the info about the previous character. */ 1654 /* Record the info about the previous character. */