emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 d94ea9efca6: Avoid crashes in --without-all build trying to sca


From: Eli Zaretskii
Subject: emacs-29 d94ea9efca6: Avoid crashes in --without-all build trying to scale non-ASCII char
Date: Tue, 9 May 2023 01:21:05 -0400 (EDT)

branch: emacs-29
commit d94ea9efca663510ce2cf8c6df327404d92afa0a
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Avoid crashes in --without-all build trying to scale non-ASCII char
    
    * src/fontset.c (face_for_char): Display a non-ASCII character as
    glyphless if the ASCII face has no fontset.  (Bug#63283)
---
 src/fontset.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/fontset.c b/src/fontset.c
index f196dee8259..c0e00cfa346 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -967,6 +967,15 @@ face_for_char (struct frame *f, struct face *face, int c,
 #endif
     }
 
+  /* If the parent face has no fontset we could work with, and has no
+     font, just return that same face, so that the caller will
+     consider the character to have no font capable of displaying it,
+     and display it as "glyphless".  That is certainly better than
+     violating the assertion below or crashing when assertions are not
+     compiled in.  */
+  if (face->fontset < 0 && !face->font)
+    return face->id;
+
   eassert (fontset_id_valid_p (face->fontset));
   fontset = FONTSET_FROM_ID (face->fontset);
   eassert (!BASE_FONTSET_P (fontset));



reply via email to

[Prev in Thread] Current Thread [Next in Thread]