From 83964e0468e7f4ae39cd1435f3b53f62e174ac21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Magalh=C3=A3es?= Date: Fri, 1 Dec 2017 16:08:11 +0000 Subject: Fix #75607 - Check if existing static trait property is a ref before comparing --- Zend/zend_inheritance.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Zend/zend_inheritance.c') diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 7689a7c963..383df1a0f9 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -1568,13 +1568,17 @@ static void zend_do_traits_property_binding(zend_class_entry *ce) /* {{{ */ if ((coliding_prop->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC)) == (flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))) { /* flags are identical, now the value needs to be checked */ + zval *op1, *op2; if (flags & ZEND_ACC_STATIC) { - not_compatible = fast_is_not_identical_function(&ce->default_static_members_table[coliding_prop->offset], - &ce->traits[i]->default_static_members_table[property_info->offset]); + op1 = &ce->default_static_members_table[coliding_prop->offset]; + op2 = &ce->traits[i]->default_static_members_table[property_info->offset]; + ZVAL_DEREF(op1); + ZVAL_DEREF(op2); } else { - not_compatible = fast_is_not_identical_function(&ce->default_properties_table[OBJ_PROP_TO_NUM(coliding_prop->offset)], - &ce->traits[i]->default_properties_table[OBJ_PROP_TO_NUM(property_info->offset)]); + op1 = &ce->default_properties_table[OBJ_PROP_TO_NUM(coliding_prop->offset)]; + op2 = &ce->traits[i]->default_properties_table[OBJ_PROP_TO_NUM(property_info->offset)]; } + not_compatible = fast_is_not_identical_function(op1, op2); } else { /* the flags are not identical, thus, we assume properties are not compatible */ not_compatible = 1; -- cgit v1.2.1