[ Disclaimer: I don't understand glyph code. ]
Andy Piper <andyp(a)bea.com> writes:
I'm inclined to think the assertion is wrong, although I'm
not convinced
about this since I don't understand why we haven't seen this with other
things.
I don't think the assertion is wrong. The easiest way to
reproduce crash is xemacs -nw and evaluate following
expression. (substitute "white.xpm" to (locate-data-file
"xemacs.xpm") or some other xpm.)
(glyph-height
(make-glyph (vector 'xpm :data
(with-temp-buffer (insert-file-contents "white.xpm")
(buffer-string)))))
Oddly,
(glyph-height
(make-glyph (vector 'xpm :file "white.xpm")))
doesn't crash.
The problem is, now image_instantiate doesn't instantiate
[nothing] and signals an error instead. If you evaluate
above expression, image_instantiate is called twice. First
one is XPM specifier and second one is its fallback,
[nothing]. The first time, it signals an error and this is
a right behavior. The second time,
instance = Fgethash (pointerp ? ls3 : glyph,
subtable, Qunbound);
return nil instead of correct unbound. I compared the code
with 21.1 and using glyph here looks really suspicious. All
the logic is same and now glyph is used instead of
instantiator. I replaced glyph with instantiator like
following patch and Bingo! The crash went away. However,
this patch apparently breaks glyph code. Could you provide
a right fix?
Index: glyphs.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs.c,v
retrieving revision 1.23.2.86
diff -u -r1.23.2.86 glyphs.c
--- glyphs.c 2000/11/07 23:24:28 1.23.2.86
+++ glyphs.c 2000/12/05 05:19:22
@@ -3139,7 +3139,7 @@
{
pointer_fg = FACE_FOREGROUND (Vpointer_face, domain);
pointer_bg = FACE_BACKGROUND (Vpointer_face, domain);
- ls3 = list3 (glyph, pointer_fg, pointer_bg);
+ ls3 = list3 (instantiator, pointer_fg, pointer_bg);
}
/* First look in the device cache. */
@@ -3179,7 +3179,7 @@
}
else
{
- instance = Fgethash (pointerp ? ls3 : glyph,
+ instance = Fgethash (pointerp ? ls3 : instantiator,
subtable, Qunbound);
}
}
@@ -3188,7 +3188,7 @@
/* Subwindows have a per-window cache and have to be treated
differently. */
instance =
- Fgethash (pointerp ? ls3 : glyph,
+ Fgethash (pointerp ? ls3 : instantiator,
XWINDOW (governing_domain)->subwindow_instance_cache,
Qunbound);
}
@@ -3201,7 +3201,7 @@
{
Lisp_Object locative =
noseeum_cons (Qnil,
- noseeum_cons (pointerp ? ls3 : glyph,
+ noseeum_cons (pointerp ? ls3 : instantiator,
DEVICEP (governing_domain) ? subtable
: XWINDOW (governing_domain)
->subwindow_instance_cache));
@@ -3234,7 +3234,7 @@
#ifdef ERROR_CHECK_GLYPHS
if (image_instance_type_to_mask (XIMAGE_INSTANCE_TYPE (instance))
& (IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK))
- assert (EQ (Fgethash ((pointerp ? ls3 : glyph),
+ assert (EQ (Fgethash ((pointerp ? ls3 : instantiator),
XWINDOW (governing_domain)
->subwindow_instance_cache,
Qunbound), instance));
--
Yoshiki Hayashi