]> granicus.if.org Git - vim/commitdiff
patch 8.1.0564: setting v:errors to wrong type still possible v8.1.0564
authorBram Moolenaar <Bram@vim.org>
Wed, 5 Dec 2018 17:43:28 +0000 (18:43 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 5 Dec 2018 17:43:28 +0000 (18:43 +0100)
Problem:    Setting v:errors to wrong type still possible.
Solution:   Return after giving an error message. (Christian Brabandt)

src/eval.c
src/testdir/test_eval_stuff.vim
src/version.c

index 1dae2bfba9e95e5a8767cef94b1bc118308370c2..8839e057241c663bda177bbf940934fc0785cb2d 100644 (file)
@@ -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);
index bcf45cc784fdb92bb7be2c982e6d37cf92b623a2..a1aa7887835c5d8f3c5ee1050a0288c0d4159f7b 100644 (file)
@@ -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
index 474c96b96a10292aba9159e2ceb87b716a7e9410..bc442425ad55d0782fbd514523fbd2fc7dbcfe7d 100644 (file)
@@ -792,6 +792,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    564,
 /**/
     563,
 /**/