Problem: Vim9: segfault in object_equal()
Solution: test for object pointer being NULL, before dereferencing them
(Ernie Rael)
closes: #15085
Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
assert_equal(true, result)
END
v9.CheckScriptSuccess(lines)
+
+ lines =<< trim END
+ vim9script
+
+ class C
+ public var nest: C
+ endclass
+ var o1 = C.new()
+ var o2 = C.new(C.new())
+
+ var result = o1 == o2
+ assert_equal(false, result)
+ END
+ v9.CheckScriptSuccess(lines)
enddef
" Test for using a compound operator from a lambda function in an object method
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 515,
/**/
514,
/**/
if (o1 == o2)
return TRUE;
+ if (o1 == NULL || o2 == NULL)
+ return FALSE;
cl1 = o1->obj_class;
cl2 = o2->obj_class;