From: Po Lu Date: Fri, 16 Sep 2022 07:52:21 +0000 (+0800) Subject: Avoid asserting for fontset validity before it is used X-Git-Tag: emacs-29.0.90~1856^2~466 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3c0dda2663e38635163f0fd6c19748c6eba1c3c8;p=emacs.git Avoid asserting for fontset validity before it is used * src/fontset.c (face_for_char): Move `eassert' to before the fontset is really used. Suggested by Eli Zaretskii --- diff --git a/src/fontset.c b/src/fontset.c index 1793715450e..4b91eff2ef6 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -922,8 +922,6 @@ face_for_char (struct frame *f, struct face *face, int c, int face_id; int id; - eassert (fontset_id_valid_p (face->fontset)); - if (ASCII_CHAR_P (c) || CHAR_BYTE8_P (c)) return face->ascii_face->id; @@ -969,6 +967,7 @@ face_for_char (struct frame *f, struct face *face, int c, #endif } + eassert (fontset_id_valid_p (face->fontset)); fontset = FONTSET_FROM_ID (face->fontset); eassert (!BASE_FONTSET_P (fontset));