Björn Linse wrote:

> To reproduce:
> 
> vim -u NONE -i NONE 
> :let x = getreg("a",1,1)
> :call setreg("0",x)
> 
> gives SIGSEGV on master vim (huge build). "-i NONE" is needed to make sure 
> registers are undefined.
> 
> it seems like getreg returns a NULL list (I don't know if that is supposed to 
> be a thing) for an undefined register, but setreg doesn't handle it.
> 
> Maybe the NULL list is meant to behave like a locked empty list, but then
> :call add(x, something)
> should be an error right? Right now it apparently succeeds but len(x) is 
> still 0.

Internally a list with a NULL pointer is supposed to be handled like an
empty list.  This is efficient, but tricky.  Nikolai just sent a patch,
hopefully that helps.

The same thing happens for a string and a dict.

-- 
'I generally avoid temptation unless I can't resist it."
                -- Mae West

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.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

--- 
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.

Raspunde prin e-mail lui