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 -- [email protected] -- 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 ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202010051724.095HOcsd2461783%40masaka.moolenaar.net.