aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/userfunc.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-04-29 00:35:44 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-05-03 13:16:38 -0400
commita89d64b68760094f9da3b8b10442c1f86942351c (patch)
tree36df99af2ccfae521036a44604370620c7abf086 /src/nvim/eval/userfunc.c
parent66369cd9d03bf4b09c354f4a23ed24adad834408 (diff)
downloadrneovim-a89d64b68760094f9da3b8b10442c1f86942351c.tar.gz
rneovim-a89d64b68760094f9da3b8b10442c1f86942351c.tar.bz2
rneovim-a89d64b68760094f9da3b8b10442c1f86942351c.zip
vim-patch:8.1.0868: crash if triggering garbage collector after a function call
Problem: Crash if triggering garbage collector after a function call. (Michael Henry) Solution: Don't call the garbage collector right away, do it later. (closes vim/vim#3894) https://github.com/vim/vim/commit/889da2f2438c8168f9a25dc776360b81109bad44
Diffstat (limited to 'src/nvim/eval/userfunc.c')
-rw-r--r--src/nvim/eval/userfunc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c
index 6e3c6c592a..ae8557a8bc 100644
--- a/src/nvim/eval/userfunc.c
+++ b/src/nvim/eval/userfunc.c
@@ -613,10 +613,10 @@ static void cleanup_function_call(funccall_T *fc)
if (++made_copy == 10000) {
// We have made a lot of copies. This can happen when
// repetitively calling a function that creates a reference to
- // itself somehow. Call the garbage collector here to avoid using
+ // itself somehow. Call the garbage collector soon to avoid using
// too much memory.
made_copy = 0;
- (void)garbage_collect(false);
+ want_garbage_collect = true;
}
}
}