From: Stefan Kangas Date: Sat, 15 Jan 2022 05:47:59 +0000 (+0100) Subject: Merge from origin/emacs-28 X-Git-Tag: emacs-29.0.90~3040 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8df828e40522b7696cde6ec22a4657173c9f02a1;p=emacs.git Merge from origin/emacs-28 5990148860 * lisp/simple.el (undo-no-redo): Fix customization group ac2cdb8a46 * lisp/progmodes/xref.el (xref-file-name-display): Fix doc... c05864dd25 Avoid another segfault in 'face_at_buffer_position' --- 8df828e40522b7696cde6ec22a4657173c9f02a1 diff --cc src/xfaces.c index 8064d47c947,dff5ae346de..e148b5d3987 --- a/src/xfaces.c +++ b/src/xfaces.c @@@ -6419,12 -6424,13 +6419,16 @@@ face_at_buffer_position (struct window face_id = lookup_basic_face (w, f, DEFAULT_FACE_ID); default_face = FACE_FROM_ID_OR_NULL (f, face_id); + /* Make sure the default face ID is usable: if someone freed the + cached faces since we've looked up these faces, we need to look + them up again. */ if (!default_face) - default_face = FACE_FROM_ID (f, - lookup_basic_face (w, f, DEFAULT_FACE_ID)); + { + if (FRAME_FACE_CACHE (f)->used == 0) + recompute_basic_faces (f); + default_face = FACE_FROM_ID (f, + lookup_basic_face (w, f, DEFAULT_FACE_ID)); + } } /* Optimize common cases where we can use the default face. */