Skip to content

Commit 9b123d8

Browse files
committed
patch 8.2.1687: Vim9: out of bounds error
Problem: Vim9: out of bounds error. Solution: Check that cmdidx is not negative.
1 parent 71abe48 commit 9b123d8

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
1687,
753755
/**/
754756
1686,
755757
/**/

src/vim9compile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6903,7 +6903,8 @@ compile_def_function(ufunc_T *ufunc, int set_return_type, cctx_T *outer_cctx)
69036903
if (ea.cmdidx != CMD_SIZE
69046904
&& ea.cmdidx != CMD_write && ea.cmdidx != CMD_read)
69056905
{
6906-
ea.argt = excmd_get_argt(ea.cmdidx);
6906+
if (ea.cmdidx >= 0)
6907+
ea.argt = excmd_get_argt(ea.cmdidx);
69076908
if ((ea.argt & EX_BANG) && *p == '!')
69086909
{
69096910
ea.forceit = TRUE;

0 commit comments

Comments
 (0)