Mirror of the Vim source from https://github.com/vim/vim
Revision | e45b2e28e45e90727cae9fc13b713f888e4f9d32 (tree) |
---|---|
Zeit | 2021-02-24 20:30:03 |
Autor | Bram Moolenaar <Bram@vim....> |
Commiter | Bram Moolenaar |
patch 8.2.2549: crash after using "g:" in a for loop
Commit: https://github.com/vim/vim/commit/1bd3cb201983859d86d644eef9e98cd3e9de7261
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Feb 24 12:27:31 2021 +0100
@@ -2545,6 +2545,12 @@ | ||
2545 | 2545 | assert_equal('some', get(t:, 'some_var', 'xxx')) |
2546 | 2546 | assert_equal('xxx', get(t:, 'no_var', 'xxx')) |
2547 | 2547 | unlet t:some_var |
2548 | + | |
2549 | + # check using g: in a for loop more than DO_NOT_FREE_CNT times | |
2550 | + for i in range(100000) | |
2551 | + if has_key(g:, 'does-not-exist') | |
2552 | + endif | |
2553 | + endfor | |
2548 | 2554 | enddef |
2549 | 2555 | |
2550 | 2556 | def Test_expr7_parens() |
@@ -751,6 +751,8 @@ | ||
751 | 751 | static int included_patches[] = |
752 | 752 | { /* Add new patch number below this line */ |
753 | 753 | /**/ |
754 | + 2549, | |
755 | +/**/ | |
754 | 756 | 2548, |
755 | 757 | /**/ |
756 | 758 | 2547, |
@@ -1771,6 +1771,7 @@ | ||
1771 | 1771 | tv->v_type = VAR_DICT; |
1772 | 1772 | tv->v_lock = 0; |
1773 | 1773 | tv->vval.v_dict = d; |
1774 | + ++d->dv_refcount; | |
1774 | 1775 | ++ectx.ec_stack.ga_len; |
1775 | 1776 | } |
1776 | 1777 | break; |