From: Eli Zaretskii Date: Sun, 31 May 2020 14:23:11 +0000 (+0300) Subject: Avoid crashes due to bidi cache being reset during redisplay X-Git-Tag: emacs-27.1-rc1~95 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=41232e679732fcd37fc56edda90035d6f98b591f;p=emacs.git Avoid crashes due to bidi cache being reset during redisplay If automatic character composition triggers GC, and 'garbage-collection-messages' are turned on, we could have the bidi cache reset while processing RTL text, which would then consistently crash. * src/xdisp.c (display_echo_area_1): Protect the bidi cache against changes inside 'try_window'. --- diff --git a/src/xdisp.c b/src/xdisp.c index bff6218106b..60848f4433e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -11539,7 +11539,9 @@ display_echo_area_1 (ptrdiff_t a1, Lisp_Object a2) /* Display. */ clear_glyph_matrix (w->desired_matrix); XSETWINDOW (window, w); + void *itdata = bidi_shelve_cache (); try_window (window, start, 0); + bidi_unshelve_cache (itdata, false); return window_height_changed_p; }