From b63ea1047a5c130231cec5571861f1dcdf63a063 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 16 Feb 2021 14:20:45 +0100 Subject: Mark resource-like objects as non-comparable As these hold on to some internal resource, there can't be two "equal" objects with different identity. Make sure the lack of public properties doesn't result in these being treated as always equal. --- ext/enchant/enchant.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ext/enchant') diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c index 5661975820..b602620c2a 100644 --- a/ext/enchant/enchant.c +++ b/ext/enchant/enchant.c @@ -199,6 +199,7 @@ PHP_MINIT_FUNCTION(enchant) enchant_broker_handlers.offset = XtOffsetOf(enchant_broker, std); enchant_broker_handlers.free_obj = php_enchant_broker_free; enchant_broker_handlers.clone_obj = NULL; + enchant_broker_handlers.compare = zend_objects_not_comparable; INIT_CLASS_ENTRY(dce, "EnchantDictionary", class_EnchantDictionary_methods); enchant_dict_ce = zend_register_internal_class(&dce); @@ -211,6 +212,7 @@ PHP_MINIT_FUNCTION(enchant) enchant_dict_handlers.offset = XtOffsetOf(enchant_dict, std); enchant_dict_handlers.free_obj = php_enchant_dict_free; enchant_dict_handlers.clone_obj = NULL; + enchant_dict_handlers.compare = zend_objects_not_comparable; REGISTER_LONG_CONSTANT("ENCHANT_MYSPELL", PHP_ENCHANT_MYSPELL, CONST_CS | CONST_PERSISTENT | CONST_DEPRECATED); REGISTER_LONG_CONSTANT("ENCHANT_ISPELL", PHP_ENCHANT_ISPELL, CONST_CS | CONST_PERSISTENT | CONST_DEPRECATED); -- cgit v1.2.1