GNU bug report logs - #9983
valgrind warning in draw_glyphs

Previous Next

Package: emacs;

Reported by: Dan Nicolaescu <dann <at> gnu.org>

Date: Mon, 7 Nov 2011 04:40:01 UTC

Severity: normal

Done: Dan Nicolaescu <dann <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 9983 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dan Nicolaescu <dann <at> gnu.org>
Cc: 9983 <at> debbugs.gnu.org
Subject: Re: bug#9983: valgrind warning in draw_glyphs
Date: Mon, 07 Nov 2011 00:49:07 -0500
> From: Dan Nicolaescu <dann <at> gnu.org>
> Date: Sun, 06 Nov 2011 23:36:42 -0500
> 
> The warning is for this:
>         if (check_mouse_face
>               && mouse_beg_col < start && mouse_end_col > i)
> 
> it looks like mouse_beg_col and mouse_end_col could be left uninitialized a few lines above.

I don't see how.  These variables are initialized in this block:

	  if (row >= mouse_beg_row && row <= mouse_end_row)
	    {
	      check_mouse_face = 1;
	      mouse_beg_col = (row == mouse_beg_row)
		? hlinfo->mouse_face_beg_col : 0;
	      mouse_end_col = (row == mouse_end_row)
		? hlinfo->mouse_face_end_col
		: row->used[TEXT_AREA];
	    }

check_mouse_face starts as zero, and is only set to 1 in this block.
So any test that is conditioned on check_mouse_face being non-zero is
okay with looking at mouse_beg_col and mouse_end_col.

The other variables in the line being flagged, `start' and `i', are
also okay: `start' is one of the call arguments and `i' is computed
right before the line being flagged.

Did I miss something?




This bug report was last modified 13 years and 198 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.