From dad452552bebf832e737ebb946b5eea6cd57f63f Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sun, 6 Nov 2022 19:42:36 +0800 Subject: [PATCH] Pacify -Wnull-dereference * src/xdisp.c (extend_face_to_end_of_line): Use FACE_FROM_ID, not FACE_FROM_ID_OR_NULL, when the next line proceeds to immediately dereference the face. --- src/xdisp.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 054adb9d9d9..ea193601b54 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -23154,14 +23154,14 @@ extend_face_to_end_of_line (struct it *it) point temporarily moved to window-point. */ specbind (Qinhibit_quit, Qt); /* The default face, possibly remapped. */ - struct face *default_face = - FACE_FROM_ID_OR_NULL (f, lookup_basic_face (it->w, f, DEFAULT_FACE_ID)); - const int extend_face_id = - (it->face_id == default_face->id || it->s != NULL) - ? it->face_id - : (it->glyph_row->ends_at_zv_p - ? default_face->id - : face_at_pos (it, LFACE_EXTEND_INDEX)); + struct face *default_face + = FACE_FROM_ID (f, lookup_basic_face (it->w, f, DEFAULT_FACE_ID)); + const int extend_face_id + = ((it->face_id == default_face->id || it->s != NULL) + ? it->face_id + : (it->glyph_row->ends_at_zv_p + ? default_face->id + : face_at_pos (it, LFACE_EXTEND_INDEX))); unbind_to (count, Qnil); /* Face extension extends the background and box of IT->extend_face_id -- 2.39.2