ZyX wrote:
> Attached script, being sourced causes vim to hang up forever.
> Test command:
>     vim -u NONE -c 'so bug.vim'

To clarify the problem, start Vim 7.3.3 and enter the following
(this is the essence of the script mentioned above, and will
cause Vim to hang, so close all files first):

:let l=[]
:call add(l, l)
:let dict4={"l": l}
:call add(dict4.l, dict4)
:echo (dict4 ==# deepcopy(dict4))

The last line causes Vim to hang (CPU goes to 100%, memory is
not consumed).

Starting an investigation:

:let l=[]
:call add(l, l)
:echo 'l=' l
:let k=[]
:call add(k, deepcopy(k))
:echo 'k=' k

The above displays:

l= [[...]]
k= [[]]

I do not know what the "..." means but it is probably a bad
sign. Further investigation confirms this:

:redir @a
:let exp = 'l'
:for i in range(1, 10)
:  execute 'let val = ' . exp
:  echo exp '=' val
:  unlet val
:  let exp .= '[0]'
:endfor
:redir END
:$put a

---Output---
l = [[...]]
l[0] = [[...]]
l[0][0] = [[...]]
l[0][0][0] = [[...]]
l[0][0][0][0] = [[...]]
l[0][0][0][0][0] = [[...]]
l[0][0][0][0][0][0] = [[...]]
l[0][0][0][0][0][0][0] = [[...]]
l[0][0][0][0][0][0][0][0] = [[...]]
l[0][0][0][0][0][0][0][0][0] = [[...]]

Also, the output from:

:echo string(l)

is
E724: variable nested too deep for displaying

John

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