Mercurial > vim
comparison src/vim9.h @ 23330:e8eb4fd44902 v8.2.2208
patch 8.2.2208: Vim9: after reloading a script variable index may be invalid
Commit: https://github.com/vim/vim/commit/4aab88d919168ce2ddf4845482f4cff9efa52b5b
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Dec 24 21:56:41 2020 +0100
patch 8.2.2208: Vim9: after reloading a script variable index may be invalid
Problem: Vim9: after reloading a script variable index may be invalid.
Solution: When the sequence number doesn't match give an error for using a
script-local variable from a compiled function. (closes #7547)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 24 Dec 2020 22:00:04 +0100 |
parents | 112fa621b127 |
children | f181fe2150ab |
comparison
equal
deleted
inserted
replaced
23329:2d0d83f002e8 | 23330:e8eb4fd44902 |
---|---|
242 int ls_sid; // script ID | 242 int ls_sid; // script ID |
243 } loadstore_T; | 243 } loadstore_T; |
244 | 244 |
245 // arguments to ISN_LOADSCRIPT and ISN_STORESCRIPT | 245 // arguments to ISN_LOADSCRIPT and ISN_STORESCRIPT |
246 typedef struct { | 246 typedef struct { |
247 int script_sid; // script ID | 247 int sref_sid; // script ID |
248 int script_idx; // index in sn_var_vals | 248 int sref_idx; // index in sn_var_vals |
249 int sref_seq; // sn_script_seq when compiled | |
250 } scriptref_T; | |
251 | |
252 typedef struct { | |
253 scriptref_T *scriptref; | |
249 } script_T; | 254 } script_T; |
250 | 255 |
251 // arguments to ISN_UNLET | 256 // arguments to ISN_UNLET |
252 typedef struct { | 257 typedef struct { |
253 char_u *ul_name; // variable name with g:, w:, etc. | 258 char_u *ul_name; // variable name with g:, w:, etc. |
343 ufunc_T *df_ufunc; // struct containing most stuff | 348 ufunc_T *df_ufunc; // struct containing most stuff |
344 int df_refcount; // how many ufunc_T point to this dfunc_T | 349 int df_refcount; // how many ufunc_T point to this dfunc_T |
345 int df_idx; // index in def_functions | 350 int df_idx; // index in def_functions |
346 int df_deleted; // if TRUE function was deleted | 351 int df_deleted; // if TRUE function was deleted |
347 char_u *df_name; // name used for error messages | 352 char_u *df_name; // name used for error messages |
353 int df_script_seq; // Value of sctx_T sc_seq when the function | |
354 // was compiled. | |
348 | 355 |
349 garray_T df_def_args_isn; // default argument instructions | 356 garray_T df_def_args_isn; // default argument instructions |
350 isn_T *df_instr; // function body to be executed | 357 isn_T *df_instr; // function body to be executed |
351 int df_instr_count; | 358 int df_instr_count; |
352 | 359 |