emacs-devel
[Top][All Lists]
Advanced

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

Strange code in nsterm.m


From: Eli Zaretskii
Subject: Strange code in nsterm.m
Date: Mon, 01 Nov 2010 22:08:30 +0200

Here's mouseExited from nsterm.m:

  - (void)mouseExited: (NSEvent *)theEvent
  {
    NSPoint p = [self convertPoint: [theEvent locationInWindow] fromView: nil];
    NSRect r;
    struct ns_display_info *dpyinfo
      = emacsframe ? FRAME_NS_DISPLAY_INFO (emacsframe) : NULL;

    NSTRACE (mouseExited);

    if (dpyinfo || !emacsframe)  <<<<<<<<<<<<<<<<<<<<<<<
      return;

    last_mouse_movement_time = EV_TIMESTAMP (theEvent);

    if (emacsframe == dpyinfo->mouse_face_mouse_frame)
      {
        clear_mouse_face (dpyinfo);
        dpyinfo->mouse_face_mouse_frame = 0;
      }
  }

Isn't the line marked with <<<<<<<<<<<<<<<<<<<<<<< wrong?  It should
say

    if (!dpyinfo || !emacsframe)
      return;

right?  Because if dpyinfo is NULL, we cannot dereference it two lines
after that.  Am I missing something?



reply via email to

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