Patch 9.0.1402

7 views
Skip to first unread message

Bram Moolenaar

unread,
Mar 11, 2023, 3:57:11 PM3/11/23
to vim...@googlegroups.com

Patch 9.0.1402
Problem: Crash when using null_class.
Solution: Give an error when trying to use a null class.
Files: src/vim9class.c, src/testdir/test_vim9_class.vim


*** ../vim-9.0.1401/src/vim9class.c 2023-03-05 13:12:28.492767233 +0000
--- src/vim9class.c 2023-03-11 20:43:45.963660040 +0000
***************
*** 1262,1267 ****
--- 1262,1273 ----
cl = rettv->vval.v_object->obj_class;
}

+ if (cl == NULL)
+ {
+ emsg(_(e_incomplete_type));
+ return FAIL;
+ }
+
if (*name_end == '(')
{
int on_class = rettv->v_type == VAR_CLASS;
*** ../vim-9.0.1401/src/testdir/test_vim9_class.vim 2023-03-03 15:05:26.784832737 +0000
--- src/testdir/test_vim9_class.vim 2023-03-11 20:54:45.244021646 +0000
***************
*** 203,208 ****
--- 203,215 ----
v9.CheckScriptSuccess(lines)
enddef

+ def Test_using_null_class()
+ var lines =<< trim END
+ @_ = null_class.member
+ END
+ v9.CheckDefExecAndScriptFailure(lines, ['E715:', 'E1363:'])
+ enddef
+
def Test_class_interface_wrong_end()
var lines =<< trim END
vim9script
*** ../vim-9.0.1401/src/version.c 2023-03-11 16:18:48.457096310 +0000
--- src/version.c 2023-03-11 20:45:33.715736089 +0000
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1402,
/**/

--
hundred-and-one symptoms of being an internet addict:
265. Your reason for not staying in touch with family is that
they do not have e-mail addresses.

/// 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 ///
Reply all
Reply to author
Forward
0 new messages