aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2012-07-23 19:57:20 +0300
committerEli Zaretskii2012-07-23 19:57:20 +0300
commit436bc8e0a73e02ed0840633c4d4d4922a222db24 (patch)
tree2abf02a155efdc34837295c07b74de3593c2423e /src
parentdfce923ac9b8e14bcb2937617775cc310745978a (diff)
downloademacs-436bc8e0a73e02ed0840633c4d4d4922a222db24.tar.gz
emacs-436bc8e0a73e02ed0840633c4d4d4922a222db24.zip
Fix bug #12025 with a crash when displaying tooltips.
src/print.c (print_object): Don't crash when a frame's name is nil or invalid. src/window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as it signals an error when a tooltip frame is being created.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/print.c13
-rw-r--r--src/window.c3
3 files changed, 22 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index fb25d8dc937..40654e5a492 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12012-07-23 Eli Zaretskii <eliz@gnu.org>
2
3 * print.c (print_object): Don't crash when a frame's name is nil
4 or invalid. (Bug#12025)
5
6 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
7 it signals an error when a tooltip frame is being created.
8
12012-07-23 Dmitry Antipov <dmantipov@yandex.ru> 92012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2 10
3 Cleanup miscellaneous objects allocation and initialization. 11 Cleanup miscellaneous objects allocation and initialization.
diff --git a/src/print.c b/src/print.c
index b650b1265b1..fc435efe7c5 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1897,10 +1897,21 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
1897 else if (FRAMEP (obj)) 1897 else if (FRAMEP (obj))
1898 { 1898 {
1899 int len; 1899 int len;
1900 Lisp_Object frame_name = XFRAME (obj)->name;
1901
1900 strout ((FRAME_LIVE_P (XFRAME (obj)) 1902 strout ((FRAME_LIVE_P (XFRAME (obj))
1901 ? "#<frame " : "#<dead frame "), 1903 ? "#<frame " : "#<dead frame "),
1902 -1, -1, printcharfun); 1904 -1, -1, printcharfun);
1903 print_string (XFRAME (obj)->name, printcharfun); 1905 if (!STRINGP (frame_name))
1906 {
1907 /* A frame could be too young and have no name yet;
1908 don't crash. */
1909 if (SYMBOLP (frame_name))
1910 frame_name = Fsymbol_name (frame_name);
1911 else /* can't happen: name should be either nil or string */
1912 frame_name = build_string ("*INVALID*FRAME*NAME*");
1913 }
1914 print_string (frame_name, printcharfun);
1904 len = sprintf (buf, " %p", XFRAME (obj)); 1915 len = sprintf (buf, " %p", XFRAME (obj));
1905 strout (buf, len, len, printcharfun); 1916 strout (buf, len, len, printcharfun);
1906 PRINTCHAR ('>'); 1917 PRINTCHAR ('>');
diff --git a/src/window.c b/src/window.c
index b7b6e283cc1..e80462ae945 100644
--- a/src/window.c
+++ b/src/window.c
@@ -151,7 +151,8 @@ decode_any_window (register Lisp_Object window)
151 151
152 CHECK_WINDOW (window); 152 CHECK_WINDOW (window);
153 w = XWINDOW (window); 153 w = XWINDOW (window);
154 CHECK_LIVE_FRAME (w->frame); 154 /* The following test throws up every time a tooltip frame is displayed. */
155 /* CHECK_LIVE_FRAME (w->frame); */
155 return w; 156 return w;
156} 157}
157 158