]> granicus.if.org Git - vim/commitdiff
patch 8.2.1687: Vim9: out of bounds error v8.2.1687
authorBram Moolenaar <Bram@vim.org>
Mon, 14 Sep 2020 20:39:11 +0000 (22:39 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 14 Sep 2020 20:39:11 +0000 (22:39 +0200)
Problem:    Vim9: out of bounds error.
Solution:   Check that cmdidx is not negative.

src/version.c
src/vim9compile.c

index a0a6983714d5721b665eb17dd45472cabcc805ce..0d0eaa5ec95c508306936c8db59357a45deaa28a 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1687,
 /**/
     1686,
 /**/
index e8a3a21dbd27c889800c29fa658bdb16f260e5a2..a53f05d323662f81339798c89980a36d9d1918e1 100644 (file)
@@ -6903,7 +6903,8 @@ compile_def_function(ufunc_T *ufunc, int set_return_type, cctx_T *outer_cctx)
        if (ea.cmdidx != CMD_SIZE
                            && ea.cmdidx != CMD_write && ea.cmdidx != CMD_read)
        {
-           ea.argt = excmd_get_argt(ea.cmdidx);
+           if (ea.cmdidx >= 0)
+               ea.argt = excmd_get_argt(ea.cmdidx);
            if ((ea.argt & EX_BANG) && *p == '!')
            {
                ea.forceit = TRUE;