emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master e8a28b2: Allow null entries in face and image cache


From: Paul Eggert
Subject: [Emacs-diffs] master e8a28b2: Allow null entries in face and image cache
Date: Thu, 19 May 2016 15:39:24 +0000 (UTC)

branch: master
commit e8a28b295fabbc249c5123b58fcf2beb82f08da2
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Allow null entries in face and image cache
    
    Problem reported by Tino Calancha (Bug#23580).
    * src/dispextern.h (FACE_FROM_ID, IMAGE_FROM_ID):
    Don’t assume that the result is non-null.
    * src/xdisp.c (fill_image_glyph_string):
    Restore check that image pointer is non-null.
---
 src/dispextern.h |    2 --
 src/xdisp.c      |    1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/dispextern.h b/src/dispextern.h
index 4deebc1..e83b7c7 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1815,7 +1815,6 @@ struct face_cache
 
 #define FACE_FROM_ID(F, ID)                                    \
   (eassert (UNSIGNED_CMP (ID, <, FRAME_FACE_CACHE (F)->used)), \
-   eassume (FRAME_FACE_CACHE (F)->faces_by_id[ID]),            \
    FRAME_FACE_CACHE (F)->faces_by_id[ID])
 
 /* Return a pointer to the face with ID on frame F, or null if such a
@@ -3093,7 +3092,6 @@ struct image_cache
 
 #define IMAGE_FROM_ID(F, ID)                                   \
   (eassert (UNSIGNED_CMP (ID, <, FRAME_IMAGE_CACHE (F)->used)),        \
-   eassume (FRAME_IMAGE_CACHE (F)->images[ID]),                        \
    FRAME_IMAGE_CACHE (F)->images[ID])
 
 /* Value is a pointer to the image with id ID on frame F, or null if
diff --git a/src/xdisp.c b/src/xdisp.c
index e18af2f..10a0cf2 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -24870,6 +24870,7 @@ fill_image_glyph_string (struct glyph_string *s)
 {
   eassert (s->first_glyph->type == IMAGE_GLYPH);
   s->img = IMAGE_FROM_ID (s->f, s->first_glyph->u.img_id);
+  eassert (s->img);
   s->slice = s->first_glyph->slice.img;
   s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
   s->font = s->face->font;



reply via email to

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