Patch 8.2.1802

9 views
Skip to first unread message

Bram Moolenaar

unread,
Oct 5, 2020, 1:24:47 PM10/5/20
to vim...@googlegroups.com

Patch 8.2.1802
Problem: Vim9: crash with unterminated dict. (Dhiraj Mishra)
Solution: Return empty string instead of NULL. (closes #7084)
Files: src/vim9compile.c, src/testdir/test_vim9_expr.vim


*** ../vim-8.2.1801/src/vim9compile.c 2020-10-04 17:24:24.705711322 +0200
--- src/vim9compile.c 2020-10-05 19:22:51.564649502 +0200
***************
*** 2822,2828 ****
--- 2822,2831 ----

failret:
if (*arg == NULL)
+ {
semsg(_(e_missing_dict_end), _("[end of lines]"));
+ *arg = (char_u *)"";
+ }
dict_unref(d);
return FAIL;
}
*** ../vim-8.2.1801/src/testdir/test_vim9_expr.vim 2020-10-04 16:06:00.513884339 +0200
--- src/testdir/test_vim9_expr.vim 2020-10-05 19:22:39.872688359 +0200
***************
*** 1819,1824 ****
--- 1819,1826 ----
CheckDefExecFailure(['var x: dict<number> = #{a: "x", b: 134}'], 'E1012:', 1)
CheckDefExecFailure(['var x: dict<string> = #{a: 234, b: "1"}'], 'E1012:', 1)
CheckDefExecFailure(['var x: dict<string> = #{a: "x", b: 134}'], 'E1012:', 1)
+
+ CheckDefFailure(['var x = ({'], 'E723:', 2)
enddef

def Test_expr7_dict_vim9script()
*** ../vim-8.2.1801/src/version.c 2020-10-04 19:56:35.163869162 +0200
--- src/version.c 2020-10-05 19:19:49.153270716 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 1802,
/**/

--
A day without sunshine is like, well, night.

/// Bram Moolenaar -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages