Skip to content

Commit 88b53fd

Browse files
committed
patch 8.1.0564: setting v:errors to wrong type still possible
Problem: Setting v:errors to wrong type still possible. Solution: Return after giving an error message. (Christian Brabandt)
1 parent 74ea88c commit 88b53fd

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/eval.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7568,7 +7568,10 @@ set_var(
75687568
return;
75697569
}
75707570
else if (v->di_tv.v_type != tv->v_type)
7571+
{
75717572
EMSG2(_("E963: setting %s to value with wrong type"), name);
7573+
return;
7574+
}
75727575
}
75737576

75747577
clear_tv(&v->di_tv);

src/testdir/test_eval_stuff.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,13 @@ func Test_line_continuation()
5353
"\ and some more
5454
call assert_equal([5, 6], array)
5555
endfunc
56+
57+
func Test_E963()
58+
" These commands used to cause an internal error prior to vim 8.1.0563
59+
let v_e = v:errors
60+
let v_o = v:oldfiles
61+
call assert_fails("let v:errors=''", 'E963:')
62+
call assert_equal(v_e, v:errors)
63+
call assert_fails("let v:oldfiles=''", 'E963:')
64+
call assert_equal(v_o, v:oldfiles)
65+
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,8 @@ static char *(features[]) =
792792

793793
static int included_patches[] =
794794
{ /* Add new patch number below this line */
795+
/**/
796+
564,
795797
/**/
796798
563,
797799
/**/

0 commit comments

Comments
 (0)