From 04f7e1f56d5f8c92fad49504e0f2215fdd72d326 Mon Sep 17 00:00:00 2001 From: Jakub Łuczyński Date: Mon, 10 Feb 2020 11:23:58 +0100 Subject: fix: var_set_global --- src/nvim/eval.c | 5 ++--- src/nvim/eval/user_funcs.c | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index bd223c7b78..f7e7c3a2d8 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -9770,10 +9770,9 @@ const void *var_shada_iter(const void *const iter, const char **const name, void var_set_global(const char *const name, typval_T vartv) { - funccall_T *const saved_current_funccal = current_funccal; - current_funccal = NULL; + funccall_T *const saved_funccal = (funccall_T *)save_funccal(); set_var(name, strlen(name), &vartv, false); - current_funccal = saved_current_funccal; + restore_funccal(saved_funccal); } int store_session_globals(FILE *fd) diff --git a/src/nvim/eval/user_funcs.c b/src/nvim/eval/user_funcs.c index 487d290f6b..3c64e807ba 100644 --- a/src/nvim/eval/user_funcs.c +++ b/src/nvim/eval/user_funcs.c @@ -1117,9 +1117,7 @@ void *save_funccal(void) void restore_funccal(void *vfc) { - funccall_T *fc = (funccall_T *)vfc; - - current_funccal = fc; + current_funccal = (funccall_T *)vfc; } #if defined(EXITFREE) -- cgit