On Tuesday, August 12, 2014 5:39:05 PM UTC-4, Bram Moolenaar wrote:
> Dominique wrote:
> > Bram Moolenaar wrote:
> > > Patch 7.4.402
> > > Problem:    Test 72 crashes under certain conditions. (Kazunobu Kuriyama)
> > > Solution:   Clear the whole bufinfo_T early.
> > > Files:      src/undo.c
> > 
> > Test 72 no longer segfaults after this patch. However,
> > running it under valgrind shows access to uninitialized
> > memory:
> > 

As long as you all are working on undo.c, there is a compile warning with 32 
bit Windows MSVC

undo.c(995) : warning C4244: '=' : conversion from 'long_u' to 'char_u', 
possible loss of data

which can be eliminated with a cast

*** a/vim/src/undo.c    Sun Aug 10 13:34:30 2014
--- b/vim/src/undo.c    Tue Aug 12 09:49:48 2014
***************
*** 992,998 ****
      int           bufi = 0;
  
      for (i = len - 1; i >= 0; --i)
!       buf[bufi++] = nr >> (i * 8);
      return undo_write(bi, buf, (size_t)len);
  }
  
--- 992,998 ----
      int           bufi = 0;
  
      for (i = len - 1; i >= 0; --i)
!       buf[bufi++] = (char_u)(nr >> (i * 8));
      return undo_write(bi, buf, (size_t)len);
  }
  

Charlie

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
*** a/vim/src/undo.c	Sun Aug 10 13:34:30 2014
--- b/vim/src/undo.c	Tue Aug 12 09:49:48 2014
***************
*** 992,998 ****
      int	    bufi = 0;
  
      for (i = len - 1; i >= 0; --i)
! 	buf[bufi++] = nr >> (i * 8);
      return undo_write(bi, buf, (size_t)len);
  }
  
--- 992,998 ----
      int	    bufi = 0;
  
      for (i = len - 1; i >= 0; --i)
! 	buf[bufi++] = (char_u)(nr >> (i * 8));
      return undo_write(bi, buf, (size_t)len);
  }
  

Raspunde prin e-mail lui