unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: dann@gnu.org
Cc: 9990@debbugs.gnu.org
Subject: bug#9990: valgrind warning in add_row_entry
Date: Fri, 11 Nov 2011 17:59:22 +0200	[thread overview]
Message-ID: <83vcqqfy5h.fsf@gnu.org> (raw)
In-Reply-To: <83zkg2fzgt.fsf@gnu.org>

> Date: Fri, 11 Nov 2011 17:30:58 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 9990@debbugs.gnu.org
> 
> However, I spotted something strange related to the call to
> row_equal_p, here:
> 
>   /* Skip over rows equal at the bottom.  */
>   i = last_new;
>   j = last_old;
>   while (i - 1 > first_new
>          && j - 1 > first_old
>          && MATRIX_ROW (current_matrix, i - 1)->enabled_p
> 	 && (MATRIX_ROW (current_matrix, i - 1)->y
> 	     == MATRIX_ROW (desired_matrix, j - 1)->y)
> 	 && !MATRIX_ROW (desired_matrix, j - 1)->redraw_fringe_bitmaps_p
>          && row_equal_p (MATRIX_ROW (desired_matrix, i - 1),
>                          MATRIX_ROW (current_matrix, j - 1), 1))
>     --i, --j;
> 
> Some of these conditions use incorrect indices to access the glyph
> matrices: `i' should be used for the current matrix and `j' for the
> desired matrix.  Some of these conditions use `i' and `j' correctly,
> some don't.

Below is a patch I intend to install, if no one finds any thinko in
it.  Dan, can you try this and see if it resolves the valgrind
complaints (assuming you can reproduce them)?

=== modified file 'src/dispnew.c'
--- src/dispnew.c	2011-10-08 10:58:50 +0000
+++ src/dispnew.c	2011-11-11 15:53:27 +0000
@@ -4334,10 +4334,10 @@ scrolling_window (struct window *w, int 
   j = last_old;
   while (i - 1 > first_new
          && j - 1 > first_old
-         && MATRIX_ROW (current_matrix, i - 1)->enabled_p
-	 && (MATRIX_ROW (current_matrix, i - 1)->y
-	     == MATRIX_ROW (desired_matrix, j - 1)->y)
-	 && !MATRIX_ROW (desired_matrix, j - 1)->redraw_fringe_bitmaps_p
+         && MATRIX_ROW (current_matrix, j - 1)->enabled_p
+	 && (MATRIX_ROW (current_matrix, j - 1)->y
+	     == MATRIX_ROW (desired_matrix, i - 1)->y)
+	 && !MATRIX_ROW (desired_matrix, i - 1)->redraw_fringe_bitmaps_p
          && row_equal_p (MATRIX_ROW (desired_matrix, i - 1),
                          MATRIX_ROW (current_matrix, j - 1), 1))
     --i, --j;






  reply	other threads:[~2011-11-11 15:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-08 14:27 bug#9990: valgrind warning in add_row_entry Dan Nicolaescu
2011-11-08 17:17 ` Eli Zaretskii
2011-11-08 18:44   ` Andreas Schwab
2011-11-08 20:35     ` Eli Zaretskii
2011-11-11  5:56   ` Dan Nicolaescu
2011-11-11 15:30     ` Eli Zaretskii
2011-11-11 15:59       ` Eli Zaretskii [this message]
2011-11-11 20:20         ` Dan Nicolaescu
2011-11-12 12:04           ` Eli Zaretskii
2011-11-15 16:58             ` Dan Nicolaescu
2011-11-15 17:44               ` Eli Zaretskii
2011-11-18 12:44               ` Eli Zaretskii
2011-11-18 19:40                 ` Dan Nicolaescu
2011-11-18 21:08                   ` Eli Zaretskii
2011-11-18 21:43                     ` Dan Nicolaescu
2011-11-19  8:28                       ` Eli Zaretskii
2011-11-20 21:30                         ` Dan Nicolaescu
2011-11-15 17:21             ` Dan Nicolaescu
2011-11-15 17:49               ` Eli Zaretskii
2011-11-11 20:17       ` Dan Nicolaescu
2020-08-17 22:34 ` Stefan Kangas
2020-10-01  1:55   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83vcqqfy5h.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=9990@debbugs.gnu.org \
    --cc=dann@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).