Dominique Pelle wrote:

> On 10/15/07, Dominique Pelle <[EMAIL PROTECTED]> wrote:
> 
> > I'll try to:
> > - come up with a simpler test case  (diffing the 3 source files
> >   of vim is too complicated to verify whether diff is correct)
> 
> Bt trial and error, I've come up with 3 very simple files that are
> enough to trigger the access to uninitialized variables bug
> when diffing 3 files.  Each sample file has only 2 lines!
> 
> $ cat file1
> 1
> 2
> $ cat file2
> 2
> 3
> $ cat file3
> 0
> 1
> $ valgrind ./vim -d -u NONE -U NONE -d file1 file2 file3  2> vg.log
> 
> When doing that, vg.log contains several errors:
> 
> ==19119== Conditional jump or move depends on uninitialised value(s)
> ==19119==    at 0x8058767: diff_check (diff.c:1461)
> ==19119==    by 0x8058BFA: diff_check_fill (diff.c:1613)
> ==19119==    by 0x810822E: update_topline (move.c:214)
> ==19119==    by 0x80D7949: main (main.c:902)
> ==19119==
> ==19119== Conditional jump or move depends on uninitialised value(s)
> ==19119==    at 0x8058788: diff_check (diff.c:1465)
> ==19119==    by 0x8058BFA: diff_check_fill (diff.c:1613)
> ==19119==    by 0x810822E: update_topline (move.c:214)
> ==19119==    by 0x80D7949: main (main.c:902)
> etc (many more errors)
> 
> The diff results are also different before and after proposed patch.
> 
> With the proposed patch, there are no errors reported by valgrind.

That's good to know.

> However, I don't think that the diff output before or after patch make
> sense to me.
> 
> Without patch, nothing is highlighted in the 3rd window (file3)
> and yet, file3 is different than file1 and file2.
> 
> With patch, things are highlighted in file3 but it does not make much
> sense to me either.  Notice that line containing "1" in file3 is not
> highlighted. It does not look correct either after proposed patch.
> 
> However, I realize that I don't know exactly what diff on 3 files
> should show here.  What is the expected behavior?  Reading
> ":help diff" did not help to clarify what is expected when
> diffing 3 or 4 files.

It does look strange.  But if you diff the first and the third file you
get strange output anyway: delete one line, insert another line.  You
can imagine Vim has trouble merging this.

I also don't know what the expected behavior must be.  You can say what
looks nice in this specific situation, but it's hard to define the
mechanism.  At least it's not wrong like before.

-- 
Time is an illusion.  Lunchtime doubly so.
                -- Ford Prefect, in Douglas Adams'
                   "The Hitchhiker's Guide to the Galaxy"

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui