changeset 22276:753452747ae5 v8.2.1687

patch 8.2.1687: Vim9: out of bounds error Commit: https://github.com/vim/vim/commit/9b123d859053ad1fb91d38334726b9f24da39930 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 14 22:39:11 2020 +0200 patch 8.2.1687: Vim9: out of bounds error Problem: Vim9: out of bounds error. Solution: Check that cmdidx is not negative.
author Bram Moolenaar <Bram@vim.org>
date Mon, 14 Sep 2020 22:45:03 +0200
parents 216928dbf078
children 4575b886c258
files src/version.c src/vim9compile.c
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1687,
+/**/
     1686,
 /**/
     1685,
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -6903,7 +6903,8 @@ compile_def_function(ufunc_T *ufunc, int
 	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;