From 3c0dda2663e38635163f0fd6c19748c6eba1c3c8 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 16 Sep 2022 15:52:21 +0800 Subject: [PATCH] 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 --- src/fontset.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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)); -- 2.39.2