Patch 8.2.0485

8 views
Skip to first unread message

Bram Moolenaar

unread,
Mar 30, 2020, 3:29:18 PM3/30/20
to vim...@googlegroups.com

Patch 8.2.0485 (after 8.2.0483)
Problem: Vim9 script test fails.
Solution: Stricter condition for adding new local variable.
Files: Stricter condition for adding new local variable.


*** ../vim-8.2.0484/src/vim9compile.c 2020-03-30 21:05:41.446604275 +0200
--- src/vim9compile.c 2020-03-30 21:27:01.649643176 +0200
***************
*** 3446,3451 ****
--- 3446,3452 ----
size_t varlen;
garray_T *instr = &cctx->ctx_instr;
int idx = -1;
+ int new_local = FALSE;
char_u *op;
int opt_type;
assign_dest_T dest = dest_local;
***************
*** 3660,3665 ****
--- 3661,3667 ----
idx = reserve_local(cctx, arg, varlen, cmdidx == CMD_const, type);
if (idx < 0)
goto theend;
+ new_local = TRUE;
}

if (heredoc)
***************
*** 3721,3732 ****

// Compile the expression. Temporarily hide the new local variable
// here, it is not available to this expression.
! if (idx >= 0)
--cctx->ctx_locals.ga_len;
instr_count = instr->ga_len;
p = skipwhite(p + oplen);
r = compile_expr1(&p, cctx);
! if (idx >= 0)
++cctx->ctx_locals.ga_len;
if (r == FAIL)
goto theend;
--- 3723,3734 ----

// Compile the expression. Temporarily hide the new local variable
// here, it is not available to this expression.
! if (new_local)
--cctx->ctx_locals.ga_len;
instr_count = instr->ga_len;
p = skipwhite(p + oplen);
r = compile_expr1(&p, cctx);
! if (new_local)
++cctx->ctx_locals.ga_len;
if (r == FAIL)
goto theend;
*** ../vim-8.2.0484/src/version.c 2020-03-30 21:22:52.018545224 +0200
--- src/version.c 2020-03-30 21:28:22.093357531 +0200
***************
*** 740,741 ****
--- 740,743 ----
{ /* Add new patch number below this line */
+ /**/
+ 485,
/**/

--
Q: How do you tell the difference between a female cat and a male cat?
A: You ask it a question and if HE answers, it's a male but, if SHE
answers, it's a female.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages