summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-10-15 13:09:12 +0000
committerBram Moolenaar <Bram@vim.org>2006-10-15 13:09:12 +0000
commitb47a2405931b9fffbf678d381c3be6ff19d6e749 (patch)
tree62abdd79906e07b4c0cb143cd313655adf70b4f0
parentdf40adfcf4f29e4ee4325bbd496c0ad232244b1a (diff)
updated for version 7.0-134v7.0.134
-rw-r--r--src/eval.c18
-rw-r--r--src/version.c2
2 files changed, 15 insertions, 5 deletions
diff --git a/src/eval.c b/src/eval.c
index 13c0bd618c..aebd682f5c 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -5520,19 +5520,27 @@ tv_equal(tv1, tv2, ic)
{
char_u buf1[NUMBUFLEN], buf2[NUMBUFLEN];
char_u *s1, *s2;
+ static int recursive = 0; /* cach recursive loops */
+ int r;
- if (tv1->v_type != tv2->v_type)
+ /* Catch lists and dicts that have an endless loop by limiting
+ * recursiveness to 1000. */
+ if (tv1->v_type != tv2->v_type || recursive >= 1000)
return FALSE;
switch (tv1->v_type)
{
case VAR_LIST:
- /* recursive! */
- return list_equal(tv1->vval.v_list, tv2->vval.v_list, ic);
+ ++recursive;
+ r = list_equal(tv1->vval.v_list, tv2->vval.v_list, ic);
+ --recursive;
+ return r;
case VAR_DICT:
- /* recursive! */
- return dict_equal(tv1->vval.v_dict, tv2->vval.v_dict, ic);
+ ++recursive;
+ r = dict_equal(tv1->vval.v_dict, tv2->vval.v_dict, ic);
+ --recursive;
+ return r;
case VAR_FUNC:
return (tv1->vval.v_string != NULL
diff --git a/src/version.c b/src/version.c
index 373fa1bf87..ecf17962f6 100644
--- a/src/version.c
+++ b/src/version.c
@@ -667,6 +667,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 134,
+/**/
133,
/**/
132,