Mercurial > vim
comparison src/vim9.h @ 22371:15003353a464 v8.2.1734
patch 8.2.1734: Vim9: cannot use a funcref for a closure twice
Commit: https://github.com/vim/vim/commit/148ce7ae62e92ecf6487a4ba5902ddb7e699074b
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 23 21:57:23 2020 +0200
patch 8.2.1734: Vim9: cannot use a funcref for a closure twice
Problem: Vim9: cannot use a funcref for a closure twice.
Solution: Instead of putting the funcref on the stack use a growarray on the
execution context.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 23 Sep 2020 22:00:06 +0200 |
parents | 6b385c2b9ff5 |
children | 4097509ecc1e |
comparison
equal
deleted
inserted
replaced
22370:9a06648f05d3 | 22371:15003353a464 |
---|---|
242 } unlet_T; | 242 } unlet_T; |
243 | 243 |
244 // arguments to ISN_FUNCREF | 244 // arguments to ISN_FUNCREF |
245 typedef struct { | 245 typedef struct { |
246 int fr_func; // function index | 246 int fr_func; // function index |
247 int fr_var_idx; // variable to store partial | |
248 } funcref_T; | 247 } funcref_T; |
249 | 248 |
250 // arguments to ISN_NEWFUNC | 249 // arguments to ISN_NEWFUNC |
251 typedef struct { | 250 typedef struct { |
252 char_u *nf_lambda; // name of the lambda already defined | 251 char_u *nf_lambda; // name of the lambda already defined |
321 garray_T df_def_args_isn; // default argument instructions | 320 garray_T df_def_args_isn; // default argument instructions |
322 isn_T *df_instr; // function body to be executed | 321 isn_T *df_instr; // function body to be executed |
323 int df_instr_count; | 322 int df_instr_count; |
324 | 323 |
325 int df_varcount; // number of local variables | 324 int df_varcount; // number of local variables |
326 int df_closure_count; // number of closures created | 325 int df_has_closure; // one if a closure was created |
327 }; | 326 }; |
328 | 327 |
329 // Number of entries used by stack frame for a function call. | 328 // Number of entries used by stack frame for a function call. |
330 // - function index | 329 // - function index |
331 // - instruction index | 330 // - instruction index |