Dominique Pellé wrote:

> > $ cat use-free-mem.vim
> > let temp={}
> > redir => temp[0]
> > exe "silent! ls"
> > let temp={}
> > redir => temp[0]
> > exe "silent! ls"
> >
> > $ valgrind --leak-check=yes vim -u NONE -S use-free-mem.vim 
> > 2>/tmp/valgrind.log
> >
> > Gives the following error in /tmp/valgrind.log:
> ...snip...
> 
> Script to reproduce the bug can be simplified further.
> This is enough to reproduce the bug:
> 
> $ cat use-free-mem.vim
> 
> let temp={}
> redir => temp[0]
> let temp={}
> redir END
> 
> $ valgrind --leak-check=yes vim -u NONE -S use-free-mem.vim 
> 2>/tmp/valgrind.log
> 
> The deletion of the dictionary, while doing a redir to a member of the
> dictionary triggers the bug.  I'm looking at the code but it's not simple
> to understand.

I think the only safe way is to call get_lval() again in
var_redir_stop().  The information gathered in redir_lval may have
become invalid in the mean time.

-- 
FATAL ERROR! SYSTEM HALTED! - Press any key to continue doing nothing.

 /// 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.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui