To: vim_dev@googlegroups.com Subject: Patch 9.0.1402 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 -- Bram@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 ///