To: vim_dev@googlegroups.com Subject: Patch 8.2.2549 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2549 Problem: Crash after using "g:" in a for loop. Solution: Increment the reference count. (closes #7892) Files: src/vim9execute.c, src/testdir/test_vim9_expr.vim *** ../vim-8.2.2548/src/vim9execute.c 2021-02-22 22:45:02.179661693 +0100 --- src/vim9execute.c 2021-02-24 12:25:17.540316435 +0100 *************** *** 1771,1776 **** --- 1771,1777 ---- tv->v_type = VAR_DICT; tv->v_lock = 0; tv->vval.v_dict = d; + ++d->dv_refcount; ++ectx.ec_stack.ga_len; } break; *** ../vim-8.2.2548/src/testdir/test_vim9_expr.vim 2021-02-23 12:05:40.914627816 +0100 --- src/testdir/test_vim9_expr.vim 2021-02-24 12:26:53.883947109 +0100 *************** *** 2545,2550 **** --- 2545,2556 ---- assert_equal('some', get(t:, 'some_var', 'xxx')) assert_equal('xxx', get(t:, 'no_var', 'xxx')) unlet t:some_var + + # check using g: in a for loop more than DO_NOT_FREE_CNT times + for i in range(100000) + if has_key(g:, 'does-not-exist') + endif + endfor enddef def Test_expr7_parens() *** ../vim-8.2.2548/src/version.c 2021-02-23 19:39:16.761841193 +0100 --- src/version.c 2021-02-24 12:16:00.246588665 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2549, /**/ -- VOICE OVER: As the horrendous Black Beast lunged forward, escape for Arthur and his knights seemed hopeless, when, suddenly ... the animator suffered a fatal heart attack. ANIMATOR: Aaaaagh! VOICE OVER: The cartoon peril was no more ... The Quest for Holy Grail could continue. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///