# HG changeset patch # User Bram Moolenaar # Date 1600116303 -7200 # Node ID 753452747ae5b08da6a385c6cdfce43a3424aeed # Parent 216928dbf0788439f980d1375994f8e96e4e5990 patch 8.2.1687: Vim9: out of bounds error Commit: https://github.com/vim/vim/commit/9b123d859053ad1fb91d38334726b9f24da39930 Author: Bram Moolenaar 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. diff --git a/src/version.c b/src/version.c --- 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, diff --git a/src/vim9compile.c b/src/vim9compile.c --- 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;