diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-09-14 22:39:11 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-09-14 22:39:11 +0200 |
commit | 9b123d859053ad1fb91d38334726b9f24da39930 (patch) | |
tree | 543fd4e6d63b59761146211250846ec4288750d9 /src | |
parent | 71abe4828974af495602ffaff63cf643a16de84b (diff) | |
download | vim-git-9b123d859053ad1fb91d38334726b9f24da39930.tar.gz |
patch 8.2.1687: Vim9: out of bounds errorv8.2.1687
Problem: Vim9: out of bounds error.
Solution: Check that cmdidx is not negative.
Diffstat (limited to 'src')
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim9compile.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/version.c b/src/version.c index a0a698371..0d0eaa5ec 100644 --- 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 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; |