]> granicus.if.org Git - vim/commitdiff
patch 8.1.0868: crash if triggering garbage collector after a function call v8.1.0868
authorBram Moolenaar <Bram@vim.org>
Sat, 2 Feb 2019 13:02:30 +0000 (14:02 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 2 Feb 2019 13:02:30 +0000 (14:02 +0100)
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 #3894)

src/userfunc.c
src/version.c

index aae3fd334f3c2190237e4ceda49953a1f5c70442..acbab901f068807131278256d98166c9c2bdc368 100644 (file)
@@ -679,10 +679,10 @@ cleanup_function_call(funccall_T *fc)
        {
            // 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;
        }
     }
 }
index 92e980559fa1b01085be6a669f5a419c638114ad..1a2e2befc812ce8f3f13b881cf2f4c8496b6bfc5 100644 (file)
@@ -783,6 +783,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    868,
 /**/
     867,
 /**/