diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-06-20 03:45:36 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-06-20 03:45:36 +0200 |
commit | 75a1a9415b9c207de5a29b25c0d1949c6c9c5c61 (patch) | |
tree | 470a0887aed4e52e342edbca555e0bec1b85af99 /src/userfunc.c | |
parent | a3fce62c911c204ae144b55018f6dc9295088850 (diff) | |
download | vim-git-75a1a9415b9c207de5a29b25c0d1949c6c9c5c61.tar.gz |
patch 8.1.1575: callbacks may be garbage collectedv8.1.1575
Problem: Callbacks may be garbage collected.
Solution: Set reference in callbacks. (Ozaki Kiichi, closes #4564)
Diffstat (limited to 'src/userfunc.c')
-rw-r--r-- | src/userfunc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/userfunc.c b/src/userfunc.c index 197e2e063..8d1df0ca8 100644 --- a/src/userfunc.c +++ b/src/userfunc.c @@ -4032,12 +4032,12 @@ set_ref_in_call_stack(int copyID) funccall_T *fc; funccal_entry_T *entry; - for (fc = current_funccal; fc != NULL; fc = fc->caller) + for (fc = current_funccal; !abort && fc != NULL; fc = fc->caller) abort = abort || set_ref_in_funccal(fc, copyID); // Also go through the funccal_stack. - for (entry = funccal_stack; entry != NULL; entry = entry->next) - for (fc = entry->top_funccal; fc != NULL; fc = fc->caller) + for (entry = funccal_stack; !abort && entry != NULL; entry = entry->next) + for (fc = entry->top_funccal; !abort && fc != NULL; fc = fc->caller) abort = abort || set_ref_in_funccal(fc, copyID); return abort; |