Skip to content

Commit

Permalink
patch 8.1.0564: setting v:errors to wrong type still possible
Browse files Browse the repository at this point in the history
Problem:    Setting v:errors to wrong type still possible.
Solution:   Return after giving an error message. (Christian Brabandt)
  • Loading branch information
brammool committed Dec 5, 2018
1 parent 74ea88c commit 88b53fd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -7568,7 +7568,10 @@ set_var(
return;
}
else if (v->di_tv.v_type != tv->v_type)
{
EMSG2(_("E963: setting %s to value with wrong type"), name);
return;
}
}

clear_tv(&v->di_tv);
Expand Down
10 changes: 10 additions & 0 deletions src/testdir/test_eval_stuff.vim
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,13 @@ func Test_line_continuation()
"\ and some more
call assert_equal([5, 6], array)
endfunc

func Test_E963()
" These commands used to cause an internal error prior to vim 8.1.0563
let v_e = v:errors
let v_o = v:oldfiles
call assert_fails("let v:errors=''", 'E963:')
call assert_equal(v_e, v:errors)
call assert_fails("let v:oldfiles=''", 'E963:')
call assert_equal(v_o, v:oldfiles)
endfunc
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
564,
/**/
563,
/**/
Expand Down

0 comments on commit 88b53fd

Please sign in to comment.