Skip to content

Commit 373da7a

Browse files
committed
fix standard object handler for properties when type == BP_VAR_IS
1 parent bd90f55 commit 373da7a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Zend/zend_object_handlers.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,31 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
552552
goto exit;
553553
}
554554

555+
/* magic isset */
556+
if ((type == BP_VAR_IS) && zobj->ce->__isset) {
557+
zval tmp_object, tmp_result;
558+
zend_long *guard = zend_get_property_guard(zobj, Z_STR_P(member));
559+
560+
if (!((*guard) & IN_ISSET)) {
561+
ZVAL_COPY(&tmp_object, object);
562+
ZVAL_UNDEF(&tmp_result);
563+
564+
*guard |= IN_ISSET;
565+
zend_std_call_issetter(&tmp_object, member, &tmp_result);
566+
*guard &= ~IN_ISSET;
567+
568+
if (!zend_is_true(&tmp_result)) {
569+
retval = &EG(uninitialized_zval);
570+
zval_ptr_dtor(&tmp_object);
571+
zval_ptr_dtor(&tmp_result);
572+
goto exit;
573+
}
574+
575+
zval_ptr_dtor(&tmp_object);
576+
zval_ptr_dtor(&tmp_result);
577+
}
578+
}
579+
555580
/* magic get */
556581
if (zobj->ce->__get) {
557582
zend_long *guard = zend_get_property_guard(zobj, Z_STR_P(member));

0 commit comments

Comments
 (0)