Bram Moolenaar skribis:
>>> Matt Wozniski wrote:
>> >>>
>> >>>> function! ReturnArgs(...)
>> >>>> return a:000
>> >>>> endfunction
>> >>>>
>> >>>> " Seems to work fine?
>> >>>> echo ReturnArgs(1, 2, 3)
>> >>>>
>> >>>> " SEGV
>> >>>> echo string(ReturnArgs(1, 2, 3))
>> >>>>
>> >>>> function! MakeArgsDict(...)
>> >>>> return { 'args': a:000 }
>> >>>> endfunction
>> >>>>
>> >>>> " E685 Internal Error
>> >>>> echo MakeArgsDict(1, 2, 3)
>> >>>>
>> >>>> " SEGV
>> >>>> echo string(MakeArgsDict(1, 2, 3))
>> >>> For it crashes a while after trying these things. Most likely the
>> >>> reference count for a:000 is wrong. Never thought of someone returning
>> >>> it...
>
> [...]
>
> I have made a patch to fix this. It's complicated stuff, I hope I
> thought of everything that could possibly go wrong, including memory
> leaks.
>
> Dominique, can you try including the patch and running valgrind? And
> check for memory leaks?
It looks good to me. Patch fixes the bug and I can't see any error
or leak with valgrind memory checker. I tried all test cases reported
by Matt Wozniski, as well as "make test" (all tests passed).
-- Dominique
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---