aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2011-06-26 20:23:40 +0300
committerEli Zaretskii2011-06-26 20:23:40 +0300
commitcf99dcf81ae4732a6bf75f0b5210cebc5914d987 (patch)
tree5afa705c6d3886f4170a8fc7064b6eb1301dbf02 /src
parent6b5ccddf1c9e78417aacaf375a7e96e64a60f6d3 (diff)
downloademacs-cf99dcf81ae4732a6bf75f0b5210cebc5914d987.tar.gz
emacs-cf99dcf81ae4732a6bf75f0b5210cebc5914d987.zip
Avoid bidi-related crashes in Cperl Mode.
src/bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling bidi_at_paragraph_end, since fast_looking_at doesn't like to be called at ZV.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/bidi.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2c8b22dc321..1b395f865c8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12011-06-26 Eli Zaretskii <eliz@gnu.org>
2
3 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
4 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
5 called at ZV.
6
12011-06-26 Chong Yidong <cyd@stupidchicken.com> 72011-06-26 Chong Yidong <cyd@stupidchicken.com>
2 8
3 * process.c (wait_reading_process_output): Bypass select if 9 * process.c (wait_reading_process_output): Bypass select if
diff --git a/src/bidi.c b/src/bidi.c
index 1f3b196d5a4..469afdb3819 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -744,8 +744,6 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, int no_default_p)
744 || type == LRE || type == LRO)); 744 || type == LRE || type == LRO));
745 type = bidi_get_type (ch, NEUTRAL_DIR)) 745 type = bidi_get_type (ch, NEUTRAL_DIR))
746 { 746 {
747 if (type == NEUTRAL_B && bidi_at_paragraph_end (pos, bytepos) >= -1)
748 break;
749 if (bytepos >= ZV_BYTE) 747 if (bytepos >= ZV_BYTE)
750 { 748 {
751 /* Pretend there's a paragraph separator at end of 749 /* Pretend there's a paragraph separator at end of
@@ -753,6 +751,8 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it, int no_default_p)
753 type = NEUTRAL_B; 751 type = NEUTRAL_B;
754 break; 752 break;
755 } 753 }
754 if (type == NEUTRAL_B && bidi_at_paragraph_end (pos, bytepos) >= -1)
755 break;
756 /* Fetch next character and advance to get past it. */ 756 /* Fetch next character and advance to get past it. */
757 ch = bidi_fetch_char (bytepos, pos, &disp_pos, 757 ch = bidi_fetch_char (bytepos, pos, &disp_pos,
758 bidi_it->frame_window_p, &ch_len, &nchars); 758 bidi_it->frame_window_p, &ch_len, &nchars);