From 41232e679732fcd37fc56edda90035d6f98b591f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 31 May 2020 17:23:11 +0300 Subject: [PATCH] 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'. --- src/xdisp.c | 2 ++ 1 file changed, 2 insertions(+) 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; } -- 2.39.5