com php-src: fix standard object handler for properties when type == BP_VAR_IS: Zend/zend_object_handlers.c
| From: | Joe Watkins | Date: | Sat, 26 Mar 2016 11:15:08 +0000 |
| Subject: | com php-src: fix standard object handler for properties when type == BP_VAR_IS: Zend/zend_object_handlers.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91489@lists.php.net to get a copy of this message | ||
Commit: 373da7aa6f5e7bf57d434fd449f97770fb479d3e
Author: Joe Watkins <krakjoe@php.net> Sat, 26 Mar 2016 10:43:56 +0000
Parents: bd90f5507f63b2b624c9ad04668c67cc3d1b8952
Branches: PHP-7.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=373da7aa6f5e7bf57d434fd449f97770fb479d3e
Log:
fix standard object handler for properties when type == BP_VAR_IS
Changed paths:
M Zend/zend_object_handlers.c
Diff:
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index 7b31fdc..9abe387 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -552,6 +552,31 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void
**cache_
goto exit;
}
+ /* magic isset */
+ if ((type == BP_VAR_IS) && zobj->ce->__isset) {
+ zval tmp_object, tmp_result;
+ zend_long *guard = zend_get_property_guard(zobj, Z_STR_P(member));
+
+ if (!((*guard) & IN_ISSET)) {
+ ZVAL_COPY(&tmp_object, object);
+ ZVAL_UNDEF(&tmp_result);
+
+ *guard |= IN_ISSET;
+ zend_std_call_issetter(&tmp_object, member, &tmp_result);
+ *guard &= ~IN_ISSET;
+
+ if (!zend_is_true(&tmp_result)) {
+ retval = &EG(uninitialized_zval);
+ zval_ptr_dtor(&tmp_object);
+ zval_ptr_dtor(&tmp_result);
+ goto exit;
+ }
+
+ zval_ptr_dtor(&tmp_object);
+ zval_ptr_dtor(&tmp_result);
+ }
+ }
+
/* magic get */
if (zobj->ce->__get) {
zend_long *guard = zend_get_property_guard(zobj, Z_STR_P(member));