emacs-devel
[Top][All Lists]
Advanced

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

Re: valgrind warnings [Re: Emacs bzr memory footprint]


From: Eli Zaretskii
Subject: Re: valgrind warnings [Re: Emacs bzr memory footprint]
Date: Fri, 28 Oct 2011 17:35:05 +0200

> From: Chong Yidong <address@hidden>
> Cc: Eli Zaretskii <address@hidden>,  "Stephen J. Turnbull" <address@hidden>,  
> address@hidden
> Date: Fri, 28 Oct 2011 23:17:19 +0800
> 
> Dan Nicolaescu <address@hidden> writes:
> 
> > This is because window_from_coordinates in note_mouse_highlight is
> > passed "&part", where "part" is an uninitialized local variable.
> > When !NILP(window) "part" is not touched, so it stays uninitialized.
> > Can someone who understands this code fix this please?
> 
> Fixed; thanks.

I don't understand the fix.

--- src/xdisp.c 2011-10-19 11:46:17 +0000
+++ src/xdisp.c 2011-10-28 15:17:09 +0000
@@ -26835,11 +26835,14 @@ note_mouse_highlight (struct frame *f, i
   /* Which window is that in?  */
   window = window_from_coordinates (f, x, y, &part, 1);
 
-  /* If we were displaying active text in another window, clear that.
-     Also clear if we move out of text area in same window.  */
+  /* If displaying active text in another window, clear that.  */
   if (! EQ (window, hlinfo->mouse_face_window)
-      || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE
-         && !NILP (hlinfo->mouse_face_window)))
+      /* Also clear if we move out of text area in same window.  */
+      || (!NILP (hlinfo->mouse_face_window)
+         && !NILP (window)
+         && part != ON_TEXT
+         && part != ON_MODE_LINE
+         && part != ON_HEADER_LINE))
     clear_mouse_face (hlinfo);

What is the purpose of testing that "window" is non-nil?  How can it
be nil if it is EQ to hlinfo->mouse_face_window, which is non-nil?

That's the only real change in this revision, AFAICS.

What am I missing?




reply via email to

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