mirror of
https://github.com/vim/vim.git
synced 2025-07-25 10:54:51 -04:00
patch 9.1.0515: Vim9: segfault in object_equal()
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>
This commit is contained in:
parent
7b29cc97d6
commit
8625714ac1
@ -10502,6 +10502,20 @@ def Test_Object_Compare_With_Recursive_Class_Ref()
|
|||||||
assert_equal(true, result)
|
assert_equal(true, result)
|
||||||
END
|
END
|
||||||
v9.CheckScriptSuccess(lines)
|
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
|
enddef
|
||||||
|
|
||||||
" Test for using a compound operator from a lambda function in an object method
|
" Test for using a compound operator from a lambda function in an object method
|
||||||
|
@ -704,6 +704,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
515,
|
||||||
/**/
|
/**/
|
||||||
514,
|
514,
|
||||||
/**/
|
/**/
|
||||||
|
@ -3855,6 +3855,8 @@ object_equal(
|
|||||||
|
|
||||||
if (o1 == o2)
|
if (o1 == o2)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
if (o1 == NULL || o2 == NULL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
cl1 = o1->obj_class;
|
cl1 = o1->obj_class;
|
||||||
cl2 = o2->obj_class;
|
cl2 = o2->obj_class;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user