Mercurial > vim
comparison src/vim9.h @ 23285:112fa621b127 v8.2.2188
patch 8.2.2188: Vim9: crash when calling global function from :def function
Commit: https://github.com/vim/vim/commit/cd45ed03bfdd7fac53d562ad402df74bd26e7754
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Dec 22 17:35:54 2020 +0100
patch 8.2.2188: Vim9: crash when calling global function from :def function
Problem: Vim9: crash when calling global function from :def function.
Solution: Set the outer context. Define the partial for the context on the
original function. Use a refcount to keep track of which ufunc is
using a dfunc. (closes #7525)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 22 Dec 2020 17:45:03 +0100 |
parents | 00f7cd9b6033 |
children | e8eb4fd44902 |
comparison
equal
deleted
inserted
replaced
23284:3d54c7fa353c | 23285:112fa621b127 |
---|---|
339 /* | 339 /* |
340 * Info about a function defined with :def. Used in "def_functions". | 340 * Info about a function defined with :def. Used in "def_functions". |
341 */ | 341 */ |
342 struct dfunc_S { | 342 struct dfunc_S { |
343 ufunc_T *df_ufunc; // struct containing most stuff | 343 ufunc_T *df_ufunc; // struct containing most stuff |
344 int df_refcount; // how many ufunc_T point to this dfunc_T | |
344 int df_idx; // index in def_functions | 345 int df_idx; // index in def_functions |
345 int df_deleted; // if TRUE function was deleted | 346 int df_deleted; // if TRUE function was deleted |
347 char_u *df_name; // name used for error messages | |
346 | 348 |
347 garray_T df_def_args_isn; // default argument instructions | 349 garray_T df_def_args_isn; // default argument instructions |
348 isn_T *df_instr; // function body to be executed | 350 isn_T *df_instr; // function body to be executed |
349 int df_instr_count; | 351 int df_instr_count; |
350 | 352 |