Mirror of the Vim source from https://github.com/vim/vim
Révision | 58059676e24a6fbbc686faf84c612cfa8c25485d (tree) |
---|---|
l'heure | 2006-10-15 22:09:12 |
Auteur | vimboss |
Commiter | vimboss |
updated for version 7.0-134
@@ -5520,19 +5520,27 @@ | ||
5520 | 5520 | { |
5521 | 5521 | char_u buf1[NUMBUFLEN], buf2[NUMBUFLEN]; |
5522 | 5522 | char_u *s1, *s2; |
5523 | - | |
5524 | - if (tv1->v_type != tv2->v_type) | |
5523 | + static int recursive = 0; /* cach recursive loops */ | |
5524 | + int r; | |
5525 | + | |
5526 | + /* Catch lists and dicts that have an endless loop by limiting | |
5527 | + * recursiveness to 1000. */ | |
5528 | + if (tv1->v_type != tv2->v_type || recursive >= 1000) | |
5525 | 5529 | return FALSE; |
5526 | 5530 | |
5527 | 5531 | switch (tv1->v_type) |
5528 | 5532 | { |
5529 | 5533 | case VAR_LIST: |
5530 | - /* recursive! */ | |
5531 | - return list_equal(tv1->vval.v_list, tv2->vval.v_list, ic); | |
5534 | + ++recursive; | |
5535 | + r = list_equal(tv1->vval.v_list, tv2->vval.v_list, ic); | |
5536 | + --recursive; | |
5537 | + return r; | |
5532 | 5538 | |
5533 | 5539 | case VAR_DICT: |
5534 | - /* recursive! */ | |
5535 | - return dict_equal(tv1->vval.v_dict, tv2->vval.v_dict, ic); | |
5540 | + ++recursive; | |
5541 | + r = dict_equal(tv1->vval.v_dict, tv2->vval.v_dict, ic); | |
5542 | + --recursive; | |
5543 | + return r; | |
5536 | 5544 | |
5537 | 5545 | case VAR_FUNC: |
5538 | 5546 | return (tv1->vval.v_string != NULL |
@@ -667,6 +667,8 @@ | ||
667 | 667 | static int included_patches[] = |
668 | 668 | { /* Add new patch number below this line */ |
669 | 669 | /**/ |
670 | + 134, | |
671 | +/**/ | |
670 | 672 | 133, |
671 | 673 | /**/ |
672 | 674 | 132, |