mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 9.0.1402: crash when using null_class
Problem: Crash when using null_class. Solution: Give an error when trying to use a null class.
This commit is contained in:
parent
c481ad38f0
commit
d13dd30240
@ -203,6 +203,13 @@ def Test_returning_null_object()
|
||||
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
|
||||
|
@ -695,6 +695,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1402,
|
||||
/**/
|
||||
1401,
|
||||
/**/
|
||||
|
@ -1262,6 +1262,12 @@ class_object_index(
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user