From: Eli Zaretskii Date: Sun, 26 Jun 2011 17:23:40 +0000 (+0300) Subject: Avoid bidi-related crashes in Cperl Mode. X-Git-Tag: emacs-pretest-24.0.90~104^2~152^2~387 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cf99dcf81ae4732a6bf75f0b5210cebc5914d987;p=emacs.git 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. --- diff --git a/src/ChangeLog b/src/ChangeLog index 2c8b22dc321..1b395f865c8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-06-26 Eli Zaretskii + + * 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. + 2011-06-26 Chong Yidong * 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) || type == LRE || type == LRO)); type = bidi_get_type (ch, NEUTRAL_DIR)) { - if (type == NEUTRAL_B && bidi_at_paragraph_end (pos, bytepos) >= -1) - break; if (bytepos >= ZV_BYTE) { /* 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) type = NEUTRAL_B; break; } + if (type == NEUTRAL_B && bidi_at_paragraph_end (pos, bytepos) >= -1) + break; /* Fetch next character and advance to get past it. */ ch = bidi_fetch_char (bytepos, pos, &disp_pos, bidi_it->frame_window_p, &ch_len, &nchars);