Patch 8.2.3175
Problem: Vim9: using illegal pointer with inline function inside a lambda.
Solution: Clear eval_tofree_cmdline when advancing to the next line.
(closes #8578)
Files: src/eval.c, src/testdir/test_vim9_func.vim
*** ../vim-8.2.3174/src/eval.c 2021-07-11 16:52:41.355572247 +0200
--- src/eval.c 2021-07-18 13:33:20.044035899 +0200
***************
*** 2177,2182 ****
--- 2177,2187 ----
vim_free(evalarg->eval_tofree);
evalarg->eval_tofree = line;
}
+
+ // Advanced to the next line, "arg" no longer points into the previous
+ // line.
+ VIM_CLEAR(evalarg->eval_tofree_cmdline);
+
return skipwhite(line);
}
*** ../vim-8.2.3174/src/testdir/test_vim9_func.vim 2021-07-15 22:03:46.979932830 +0200
--- src/testdir/test_vim9_func.vim 2021-07-18 13:36:18.864027866 +0200
***************
*** 2265,2270 ****
--- 2265,2286 ----
})
END
CheckScriptSuccess(lines)
+
+ lines =<< trim END
+ vim9script
+
+ def s:func()
+ range(10)
+ ->mapnew((_, _) => ({
+ key: range(10)->mapnew((_, _) => {
+ return ' '
+ }),
+ }))
+ enddef
+
+ defcomp
+ END
+ CheckScriptSuccess(lines)
enddef
def Shadowed(): list<number>
*** ../vim-8.2.3174/src/version.c 2021-07-17 21:24:52.063911244 +0200
--- src/version.c 2021-07-18 13:31:41.403998899 +0200
***************
*** 757,758 ****
--- 757,760 ----
{ /* Add new patch number below this line */
+ /**/
+ 3175,
/**/
--
hundred-and-one symptoms of being an internet addict:
172. You join listservers just for the extra e-mail.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///