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/vim9compile.c b/src/vim9compile.c
index e8a3a21..a53f05d 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -6903,7 +6903,8 @@
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;