mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.0485: Vim9 script test fails
Problem: Vim9 script test fails. Solution: Stricter condition for adding new local variable.
This commit is contained in:
parent
92dba36fc8
commit
01b3862956
@ -738,6 +738,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 */
|
||||||
|
/**/
|
||||||
|
485,
|
||||||
/**/
|
/**/
|
||||||
484,
|
484,
|
||||||
/**/
|
/**/
|
||||||
|
@ -3446,6 +3446,7 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
|
|||||||
size_t varlen;
|
size_t varlen;
|
||||||
garray_T *instr = &cctx->ctx_instr;
|
garray_T *instr = &cctx->ctx_instr;
|
||||||
int idx = -1;
|
int idx = -1;
|
||||||
|
int new_local = FALSE;
|
||||||
char_u *op;
|
char_u *op;
|
||||||
int opt_type;
|
int opt_type;
|
||||||
assign_dest_T dest = dest_local;
|
assign_dest_T dest = dest_local;
|
||||||
@ -3660,6 +3661,7 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
|
|||||||
idx = reserve_local(cctx, arg, varlen, cmdidx == CMD_const, type);
|
idx = reserve_local(cctx, arg, varlen, cmdidx == CMD_const, type);
|
||||||
if (idx < 0)
|
if (idx < 0)
|
||||||
goto theend;
|
goto theend;
|
||||||
|
new_local = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (heredoc)
|
if (heredoc)
|
||||||
@ -3721,12 +3723,12 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
|
|||||||
|
|
||||||
// Compile the expression. Temporarily hide the new local variable
|
// Compile the expression. Temporarily hide the new local variable
|
||||||
// here, it is not available to this expression.
|
// here, it is not available to this expression.
|
||||||
if (idx >= 0)
|
if (new_local)
|
||||||
--cctx->ctx_locals.ga_len;
|
--cctx->ctx_locals.ga_len;
|
||||||
instr_count = instr->ga_len;
|
instr_count = instr->ga_len;
|
||||||
p = skipwhite(p + oplen);
|
p = skipwhite(p + oplen);
|
||||||
r = compile_expr1(&p, cctx);
|
r = compile_expr1(&p, cctx);
|
||||||
if (idx >= 0)
|
if (new_local)
|
||||||
++cctx->ctx_locals.ga_len;
|
++cctx->ctx_locals.ga_len;
|
||||||
if (r == FAIL)
|
if (r == FAIL)
|
||||||
goto theend;
|
goto theend;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user