emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r109194: Fix bug #12025 with a crash


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109194: Fix bug #12025 with a crash when displaying tooltips.
Date: Mon, 23 Jul 2012 19:57:20 +0300
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109194
fixes bug: http://debbugs.gnu.org/12025
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Mon 2012-07-23 19:57:20 +0300
message:
  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.
modified:
  src/ChangeLog
  src/print.c
  src/window.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-07-23 11:15:43 +0000
+++ b/src/ChangeLog     2012-07-23 16:57:20 +0000
@@ -1,3 +1,11 @@
+2012-07-23  Eli Zaretskii  <address@hidden>
+
+       * 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  <address@hidden>
 
        Cleanup miscellaneous objects allocation and initialization.

=== modified file 'src/print.c'
--- a/src/print.c       2012-07-05 18:35:48 +0000
+++ b/src/print.c       2012-07-23 16:57:20 +0000
@@ -1897,10 +1897,21 @@
       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 ('>');

=== modified file 'src/window.c'
--- a/src/window.c      2012-07-21 06:17:30 +0000
+++ b/src/window.c      2012-07-23 16:57:20 +0000
@@ -151,7 +151,8 @@
 
   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;
 }
 


reply via email to

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