diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-09-07 17:28:09 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-07 17:28:09 +0100 |
commit | 9667b2c888351b04751bdb43cba0d4ffc8c13ab1 (patch) | |
tree | 2fdab6d882454458af5b42159ef6f863f72b3867 /src/eval.c | |
parent | c9c967da09d9faf5ba989c943352274fea365841 (diff) |
patch 9.0.0406: deferred functions not invoked when partial func exitsv9.0.0406
Problem: Deferred functions not invoked when partial func exits.
Solution: Create a funccall_T when calling a :def function.
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/eval.c b/src/eval.c index c4d3781a2d..9891473813 100644 --- a/src/eval.c +++ b/src/eval.c @@ -263,10 +263,17 @@ eval_expr_typval(typval_T *expr, typval_T *argv, int argc, typval_T *rettv) if (partial->pt_func != NULL && partial->pt_func->uf_def_status != UF_NOT_COMPILED) { + funccall_T *fc = create_funccal(partial->pt_func, rettv); + int r; + + if (fc == NULL) + return FAIL; + // Shortcut to call a compiled function without overhead. - // FIXME: should create a funccal and link it in current_funccal. - if (call_def_function(partial->pt_func, argc, argv, - DEF_USE_PT_ARGV, partial, NULL, rettv) == FAIL) + r = call_def_function(partial->pt_func, argc, argv, + DEF_USE_PT_ARGV, partial, fc, rettv); + remove_funccal(); + if (r == FAIL) return FAIL; } else |