+2012-07-23 Eli Zaretskii <eliz@gnu.org>
+
+ * print.c (print_object): Don't crash when a frame's name is nil
+ or invalid. (Bug#12025)
+
+ * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
+ it signals an error when a tooltip frame is being created.
+
2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
Cleanup miscellaneous objects allocation and initialization.
else if (FRAMEP (obj))
{
int len;
+ Lisp_Object frame_name = XFRAME (obj)->name;
+
strout ((FRAME_LIVE_P (XFRAME (obj))
? "#<frame " : "#<dead frame "),
-1, -1, printcharfun);
- print_string (XFRAME (obj)->name, printcharfun);
+ if (!STRINGP (frame_name))
+ {
+ /* A frame could be too young and have no name yet;
+ don't crash. */
+ if (SYMBOLP (frame_name))
+ frame_name = Fsymbol_name (frame_name);
+ else /* can't happen: name should be either nil or string */
+ frame_name = build_string ("*INVALID*FRAME*NAME*");
+ }
+ print_string (frame_name, printcharfun);
len = sprintf (buf, " %p", XFRAME (obj));
strout (buf, len, len, printcharfun);
PRINTCHAR ('>');
CHECK_WINDOW (window);
w = XWINDOW (window);
- CHECK_LIVE_FRAME (w->frame);
+ /* The following test throws up every time a tooltip frame is displayed. */
+ /* CHECK_LIVE_FRAME (w->frame); */
return w;
}