From a89d64b68760094f9da3b8b10442c1f86942351c Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 29 Apr 2020 00:35:44 -0400 Subject: 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 --- src/nvim/eval/userfunc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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; } } } -- cgit