From 9b123d859053ad1fb91d38334726b9f24da39930 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 14 Sep 2020 22:39:11 +0200 Subject: patch 8.2.1687: Vim9: out of bounds error Problem: Vim9: out of bounds error. Solution: Check that cmdidx is not negative. --- src/version.c | 2 ++ src/vim9compile.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/version.c b/src/version.c index a0a698371..0d0eaa5ec 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1687, /**/ 1686, /**/ diff --git a/src/vim9compile.c b/src/vim9compile.c index e8a3a21db..a53f05d32 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -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; -- cgit v1.2.1