To: vim_dev@googlegroups.com Subject: Patch 8.2.1656 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1656 Problem: Vim9: callstack wrong if :def function calls :def function. Solution: Set the line number before calling. (closes #6914) Files: src/vim9execute.c, src/testdir/test_vim9_func.vim *** ../vim-8.2.1655/src/vim9execute.c 2020-09-08 22:45:31.113504961 +0200 --- src/vim9execute.c 2020-09-10 21:56:50.087072626 +0200 *************** *** 1665,1670 **** --- 1665,1671 ---- // call a :def function case ISN_DCALL: + SOURCING_LNUM = iptr->isn_lnum; if (call_dfunc(iptr->isn_arg.dfunc.cdf_idx, iptr->isn_arg.dfunc.cdf_argcount, &ectx) == FAIL) *** ../vim-8.2.1655/src/testdir/test_vim9_func.vim 2020-09-06 22:26:53.418275627 +0200 --- src/testdir/test_vim9_func.vim 2020-09-10 22:04:17.989630891 +0200 *************** *** 1776,1780 **** --- 1776,1800 ---- assert_equal('', g:ei_after) enddef + def StackTop() + eval 1 + eval 2 + # call not on fourth line + StackBot() + enddef + + def StackBot() + # throw an error + eval [][0] + enddef + + def Test_callstack_def() + try + StackTop() + catch + assert_match('Test_callstack_def\[2\]..StackTop\[4\]..StackBot, line 2', v:throwpoint) + endtry + enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker *** ../vim-8.2.1655/src/version.c 2020-09-10 21:36:03.855097495 +0200 --- src/version.c 2020-09-10 22:04:50.465526370 +0200 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 1656, /**/ -- Dreams are free, but there's a small charge for alterations. /// 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 ///