]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.0-082 v7.0.082
authorBram Moolenaar <Bram@vim.org>
Sun, 3 Sep 2006 13:34:00 +0000 (13:34 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 3 Sep 2006 13:34:00 +0000 (13:34 +0000)
src/eval.c
src/version.c

index 0762cabacb30765070ca73333b5d6a791cdbb03f..162cdf4c7be85ea792ee6dcfd979c140f9fab9be 100644 (file)
@@ -247,6 +247,17 @@ struct funccall_S
     funccall_T *caller;        /* calling function or NULL */
 };
 
+/*
+ * Struct used to make a list of all arguments used in internal functions.
+ */
+typedef struct av_list_item_S av_list_item_T;
+struct av_list_item_S {
+    av_list_item_T  *avl_next;
+    typval_T       *avl_argvars;
+};
+
+av_list_item_T *argvars_list = NULL;
+
 /*
  * Info used by a ":for" loop.
  */
@@ -6058,6 +6069,7 @@ garbage_collect()
     int                i;
     funccall_T *fc;
     int                did_free = FALSE;
+    av_list_item_T *av;
 #ifdef FEAT_WINDOWS
     tabpage_T  *tp;
 #endif
@@ -6094,6 +6106,11 @@ garbage_collect()
        set_ref_in_ht(&fc->l_avars.dv_hashtab, copyID);
     }
 
+    /* arguments for internal functions */
+    for (av = argvars_list; av != NULL; av = av->avl_next)
+       for (i = 0; av->avl_argvars[i].v_type != VAR_UNKNOWN; ++i)
+           set_ref_in_item(&av->avl_argvars[i], copyID);
+
     /*
      * 2. Go through the list of dicts and free items without the copyID.
      */
@@ -7537,9 +7554,21 @@ call_func(name, len, rettv, argcount, argvars, firstline, lastline,
                    error = ERROR_TOOMANY;
                else
                {
+                   av_list_item_T  av_list_item;
+
+                   /* Add the arguments to the "argvars_list" to avoid the
+                    * garbage collector not seeing them.  This isn't needed
+                    * for user functions, because the arguments are available
+                    * in the a: hashtab. */
+                   av_list_item.avl_argvars = argvars;
+                   av_list_item.avl_next = argvars_list;
+                   argvars_list = &av_list_item;
+
                    argvars[argcount].v_type = VAR_UNKNOWN;
                    functions[i].f_func(argvars, rettv);
                    error = ERROR_NONE;
+
+                   argvars_list = av_list_item.avl_next;
                }
            }
        }
index 114137492fe66d86ae5ff466fa658c767b386ef9..09ec9d5a38ee75e46bc8434df779a3f512eb6e98 100644 (file)
@@ -666,6 +666,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    82,
 /**/
     81,
 /**/