To: vim_dev@googlegroups.com Subject: Patch 8.2.2095 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2095 Problem: Vim9: crash when failed dict member is followed by concatenation. Solution: Remove the dict from the stack. (closes #7416) Files: src/vim9execute.c, src/testdir/test_vim9_func.vim *** ../vim-8.2.2094/src/vim9execute.c 2020-12-02 20:51:17.940731876 +0100 --- src/vim9execute.c 2020-12-05 18:11:42.201647028 +0100 *************** *** 2669,2674 **** --- 2669,2683 ---- { SOURCING_LNUM = iptr->isn_lnum; semsg(_(e_dictkey), key); + + // If :silent! is used we will continue, make sure the + // stack contents makes sense. + clear_tv(tv); + --ectx.ec_stack.ga_len; + tv = STACK_TV_BOT(-1); + clear_tv(tv); + tv->v_type = VAR_NUMBER; + tv->vval.v_number = 0; goto on_fatal_error; } clear_tv(tv); *** ../vim-8.2.2094/src/testdir/test_vim9_func.vim 2020-12-05 13:40:57.499035073 +0100 --- src/testdir/test_vim9_func.vim 2020-12-05 18:09:36.241949352 +0100 *************** *** 1794,1799 **** --- 1794,1818 ---- enddef sil! Func() assert_equal('none', g:result) + unlet g:result + END + CheckScriptSuccess(lines) + enddef + + def Test_dict_member_with_silent() + var lines =<< trim END + vim9script + g:result = 'none' + var d: dict + def Func() + try + g:result = map([], {_, v -> {}[v]})->join() .. d[''] + catch + endtry + enddef + silent! Func() + assert_equal('0', g:result) + unlet g:result END CheckScriptSuccess(lines) enddef *** ../vim-8.2.2094/src/version.c 2020-12-05 17:11:09.241679401 +0100 --- src/version.c 2020-12-05 18:04:58.290535981 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2095, /**/ -- BROTHER MAYNARD: Armaments Chapter Two Verses Nine to Twenty One. ANOTHER MONK: And St. Attila raised his hand grenade up on high saying "O Lord bless this thy hand grenade that with it thou mayest blow thine enemies to tiny bits, in thy mercy. "and the Lord did grin and people did feast upon the lambs and sloths and carp and anchovies and orang-utans and breakfast cereals and fruit bats and... BROTHER MAYNARD: Skip a bit brother ... "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 ///