Mercurial > vim
diff src/proto/vim9instr.pro @ 30269:42a6345b91fd v9.0.0470
patch 9.0.0470: in :def function all closures in loop get the same variables
Commit: https://github.com/vim/vim/commit/b46c083a5ed9e0c4ac5f3aec577946dcbe8c9dc5
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 15 17:19:37 2022 +0100
patch 9.0.0470: in :def function all closures in loop get the same variables
Problem: In a :def function all closures in a loop get the same variables.
Solution: When in a loop and a closure refers to a variable declared in the
loop, prepare for making a copy of variables for each closure.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 15 Sep 2022 18:30:04 +0200 |
parents | d1c04b4dc60d |
children | 61a688be1899 |
line wrap: on
line diff
--- a/src/proto/vim9instr.pro +++ b/src/proto/vim9instr.pro @@ -43,14 +43,15 @@ int generate_FUNCREF(cctx_T *cctx, ufunc int generate_NEWFUNC(cctx_T *cctx, char_u *lambda_name, char_u *func_name); int generate_DEF(cctx_T *cctx, char_u *name, size_t len); int generate_JUMP(cctx_T *cctx, jumpwhen_T when, int where); +int generate_WHILE(cctx_T *cctx, int funcref_idx); int generate_JUMP_IF_ARG_SET(cctx_T *cctx, int arg_off); int generate_FOR(cctx_T *cctx, int loop_idx); +int generate_ENDLOOP(cctx_T *cctx, int funcref_idx, int prev_local_count); int generate_TRYCONT(cctx_T *cctx, int levels, int where); int check_internal_func_args(cctx_T *cctx, int func_idx, int argcount, int method_call, type2_T **argtypes, type2_T *shuffled_argtypes); int generate_BCALL(cctx_T *cctx, int func_idx, int argcount, int method_call); int generate_LISTAPPEND(cctx_T *cctx); int generate_BLOBAPPEND(cctx_T *cctx); -int check_args_on_stack(cctx_T *cctx, ufunc_T *ufunc, int argcount); int generate_CALL(cctx_T *cctx, ufunc_T *ufunc, int pushed_argcount); int generate_UCALL(cctx_T *cctx, char_u *name, int argcount); int check_func_args_from_type(cctx_T *cctx, type_T *type, int argcount, int at_top, char_u *name);