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 -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202003301929.02UJTABl028258%40masaka.moolenaar.net.

Raspunde prin e-mail lui