Vim crashes with list range assign.
Steps to reproduce:
$ vim -u NONE
:let x = [0]
:let x[:] = [1, 2]
Vim: Caught deadly signal SEGV
Vim: Finished.
Please check the following patch.
diff -r 4604a182f04c src/eval.c
--- a/src/eval.c Sun Nov 30 22:51:06 2014 +0100
+++ b/src/eval.c Mon Dec 01 22:02:13 2014 +0900
@@ -2951,7 +2951,7 @@
/*
* Check whether any of the list items is locked
*/
- for (ri = rettv->vval.v_list->lv_first; ri != NULL; )
+ for (ri = rettv->vval.v_list->lv_first; ri != NULL && ll_li != NULL; )
{
if (tv_check_lock(ll_li->li_tv.v_lock, lp->ll_name))
return;
diff -r 4604a182f04c src/testdir/test55.in
--- a/src/testdir/test55.in Sun Nov 30 22:51:06 2014 +0100
+++ b/src/testdir/test55.in Mon Dec 01 22:02:13 2014 +0900
@@ -401,6 +401,11 @@
: $put =v:exception[:15] . v:exception[-1:-1]
:endtry
:$put =string(d)
+:"
+:" test for range assign
+:let l = [0]
+:let l[:] = [1, 2]
+:$put =string(l)
:endfun
:"
:call Test(1, 2, [3, 4], {5: 6}) " This may take a while
diff -r 4604a182f04c src/testdir/test55.ok
--- a/src/testdir/test55.ok Sun Nov 30 22:51:06 2014 +0100
+++ b/src/testdir/test55.ok Mon Dec 01 22:02:13 2014 +0900
@@ -129,6 +129,7 @@
{'a': {'b': 'B'}}
Vim(call):E737: a
{'a': {'b': 'B'}}
+[1, 2]
Vim(foldopen):E490:
--
Yukihiro Nakadaira - [email protected]
--
--
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.