0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.1687: Vim9: out of bounds error

Problem:    Vim9: out of bounds error.
Solution:   Check that cmdidx is not negative.
This commit is contained in:
Bram Moolenaar
2020-09-14 22:39:11 +02:00
parent 71abe48289
commit 9b123d8590
2 changed files with 4 additions and 1 deletions

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1687,
/**/ /**/
1686, 1686,
/**/ /**/

View File

@@ -6903,6 +6903,7 @@ compile_def_function(ufunc_T *ufunc, int set_return_type, cctx_T *outer_cctx)
if (ea.cmdidx != CMD_SIZE if (ea.cmdidx != CMD_SIZE
&& ea.cmdidx != CMD_write && ea.cmdidx != CMD_read) && ea.cmdidx != CMD_write && ea.cmdidx != CMD_read)
{ {
if (ea.cmdidx >= 0)
ea.argt = excmd_get_argt(ea.cmdidx); ea.argt = excmd_get_argt(ea.cmdidx);
if ((ea.argt & EX_BANG) && *p == '!') if ((ea.argt & EX_BANG) && *p == '!')
{ {