com php-src: Remove obj handlers ptr value from spl_object_ hash(): ext/spl/php_spl.c
| From: | Nikita Popov | Date: | Tue, 12 Jan 2016 15:47:21 +0000 |
| Subject: | com php-src: Remove obj handlers ptr value from spl_object_ hash(): ext/spl/php_spl.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-90625@lists.php.net to get a copy of this message | ||
Commit: 2b4625d68737c553c1fa50a5442bc976814ae855
Author: Bogdan Padalko <pinepain@gmail.com> Tue, 12 Jan 2016 01:26:34 +0200
Committer: Nikita Popov <nikic@php.net> Tue, 12 Jan 2016 16:47:21 +0100
Parents: bec0aec11691fa712750206d1b2cdd34bf6fc5a5
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2b4625d68737c553c1fa50a5442bc976814ae855
Log:
Remove obj handlers ptr value from spl_object_hash()
We still keep the same output length, for people who rely on the
return value having a specific format. The handler part will now
simply be always the same (it was the same nearly always anyway).
The motivation behind this change is to avoid breaking
spl_object_hash() and SplObjectStorage if an extension changes the
handlers table of an object. This has come up, for example, in
weakref implementations.
Changed paths:
M ext/spl/php_spl.c
Diff:
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index 57e43d4..9c7611d 100644
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -777,7 +777,7 @@ PHPAPI zend_string *php_spl_object_hash(zval *obj) /* {{{*/
}
hash_handle = SPL_G(hash_mask_handle)^(intptr_t)Z_OBJ_HANDLE_P(obj);
- hash_handlers = SPL_G(hash_mask_handlers)^(intptr_t)Z_OBJ_HT_P(obj);
+ hash_handlers = SPL_G(hash_mask_handlers);
return strpprintf(32, "%016lx%016lx", hash_handle, hash_handlers);
}