1
0
forked from aniani/vim

patch 8.2.2139: Vim9: unreachable code in assignment

Problem:    Vim9: unreachable code in assignment.
Solution:   Don't check "new_local" when "has_index" is set.  Add test for
            wrong type of list index.
This commit is contained in:
Bram Moolenaar
2020-12-13 18:44:43 +01:00
parent b5b9480ee9
commit acbae18df5
3 changed files with 14 additions and 4 deletions

View File

@@ -5856,8 +5856,6 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
int r;
// Compile the "idx" in "var[idx]" or "key" in "var.key".
if (new_local)
--cctx->ctx_locals.ga_len;
p = var_start + varlen;
if (*p == '[')
{
@@ -5877,8 +5875,6 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
r = generate_PUSHS(cctx, key);
}
if (new_local)
++cctx->ctx_locals.ga_len;
if (r == FAIL)
goto theend;