aboutsummaryrefslogtreecommitdiffstats
path: root/src/bidi.c
diff options
context:
space:
mode:
authorEli Zaretskii2011-09-28 17:37:27 +0300
committerEli Zaretskii2011-09-28 17:37:27 +0300
commitfbcaa2f3880fc9fc3a84182a0061fbdcf32ba19e (patch)
tree9816adc66a3bb1b20332f4463613a34c9e14cd93 /src/bidi.c
parent0a40c0609bf7dc47b68f13178ff07334f7dde349 (diff)
downloademacs-fbcaa2f3880fc9fc3a84182a0061fbdcf32ba19e.tar.gz
emacs-fbcaa2f3880fc9fc3a84182a0061fbdcf32ba19e.zip
Fix bug #9624 with crashes in Muse mode.
src/xdisp.c (compute_display_string_end): If there's no display string at CHARPOS, return -1. src/bidi.c (bidi_fetch_char): When compute_display_string_end returns a negative value, treat the character as a normal character not covered by a display string.
Diffstat (limited to 'src/bidi.c')
-rw-r--r--src/bidi.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/bidi.c b/src/bidi.c
index 599c00449b5..e3fc03f4a9b 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -974,6 +974,15 @@ bidi_fetch_char (EMACS_INT bytepos, EMACS_INT charpos, EMACS_INT *disp_pos,
974 ch = 0xFFFC; 974 ch = 0xFFFC;
975 } 975 }
976 disp_end_pos = compute_display_string_end (*disp_pos, string); 976 disp_end_pos = compute_display_string_end (*disp_pos, string);
977 if (disp_end_pos < 0)
978 {
979 /* Somebody removed the display string from the buffer
980 behind our back. Recover by processing this buffer
981 position as if no display property were present there to
982 begin with. */
983 *disp_prop = 0;
984 goto normal_char;
985 }
977 *nchars = disp_end_pos - *disp_pos; 986 *nchars = disp_end_pos - *disp_pos;
978 if (*nchars <= 0) 987 if (*nchars <= 0)
979 abort (); 988 abort ();
@@ -988,6 +997,7 @@ bidi_fetch_char (EMACS_INT bytepos, EMACS_INT charpos, EMACS_INT *disp_pos,
988 } 997 }
989 else 998 else
990 { 999 {
1000 normal_char:
991 if (string->s) 1001 if (string->s)
992 { 1002 {
993 int len; 1003 int len;