]> granicus.if.org Git - php/commitdiff
Support for IS_REFERENCE
authorDmitry Stogov <dmitry@zend.com>
Mon, 24 Feb 2014 12:51:38 +0000 (16:51 +0400)
committerDmitry Stogov <dmitry@zend.com>
Mon, 24 Feb 2014 12:51:38 +0000 (16:51 +0400)
Zend/zend_execute.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index 8d27453229f5b82c7545b9d65d6aaca338c7f7c9..4060ee0b14b97aaf43d65b349eba5675aa0174f1 100644 (file)
@@ -1278,6 +1278,9 @@ static void zend_fetch_dimension_address_read(zval *result, zval *container, zva
 {
        zval *retval;
 
+       if (UNEXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) {
+               container = Z_REFVAL_P(container);
+       }
        switch (Z_TYPE_P(container)) {
 
                case IS_ARRAY:
index 9dc6318fb31953d3f7c28d3c9efc1c61203d5b64..f34a080312e7e70212d21ebe3dffc244811abd26 100644 (file)
@@ -1319,6 +1319,10 @@ ZEND_VM_HELPER(zend_fetch_property_address_read_helper, VAR|UNUSED|CV, CONST|TMP
        container = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_R);
        offset  = GET_OP2_ZVAL_PTR(BP_VAR_R);
 
+       if (UNEXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) {
+               container = Z_REFVAL_P(container);
+       }
+
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
            UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
                zend_error(E_NOTICE, "Trying to get property of non-object");
index 80e68c21bcce36b575e3eeef2beacecb4596a35f..06d7092f0c73bb9dea52a54897bbca29009405c4 100644 (file)
@@ -14541,6 +14541,10 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CONST(
        container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
        offset  = opline->op2.zv;
 
+       if (UNEXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) {
+               container = Z_REFVAL_P(container);
+       }
+
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
            UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
                zend_error(E_NOTICE, "Trying to get property of non-object");
@@ -16769,6 +16773,10 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_TMP(ZE
        container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
        offset  = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
+       if (UNEXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) {
+               container = Z_REFVAL_P(container);
+       }
+
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
            UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
                zend_error(E_NOTICE, "Trying to get property of non-object");
@@ -18901,6 +18909,10 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_VAR(ZE
        container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
        offset  = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
+       if (UNEXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) {
+               container = Z_REFVAL_P(container);
+       }
+
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
            UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
                zend_error(E_NOTICE, "Trying to get property of non-object");
@@ -22189,6 +22201,10 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CV(ZEN
        container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
        offset  = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
 
+       if (UNEXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) {
+               container = Z_REFVAL_P(container);
+       }
+
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
            UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
                zend_error(E_NOTICE, "Trying to get property of non-object");
@@ -23863,6 +23879,10 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CON
        container = _get_obj_zval_ptr_unused(TSRMLS_C);
        offset  = opline->op2.zv;
 
+       if (UNEXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) {
+               container = Z_REFVAL_P(container);
+       }
+
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
            UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
                zend_error(E_NOTICE, "Trying to get property of non-object");
@@ -25200,6 +25220,10 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP
        container = _get_obj_zval_ptr_unused(TSRMLS_C);
        offset  = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
+       if (UNEXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) {
+               container = Z_REFVAL_P(container);
+       }
+
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
            UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
                zend_error(E_NOTICE, "Trying to get property of non-object");
@@ -26453,6 +26477,10 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR
        container = _get_obj_zval_ptr_unused(TSRMLS_C);
        offset  = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
+       if (UNEXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) {
+               container = Z_REFVAL_P(container);
+       }
+
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
            UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
                zend_error(E_NOTICE, "Trying to get property of non-object");
@@ -28105,6 +28133,10 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(
        container = _get_obj_zval_ptr_unused(TSRMLS_C);
        offset  = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
 
+       if (UNEXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) {
+               container = Z_REFVAL_P(container);
+       }
+
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
            UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
                zend_error(E_NOTICE, "Trying to get property of non-object");
@@ -31131,6 +31163,10 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_CONST(Z
        container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
        offset  = opline->op2.zv;
 
+       if (UNEXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) {
+               container = Z_REFVAL_P(container);
+       }
+
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
            UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
                zend_error(E_NOTICE, "Trying to get property of non-object");
@@ -33140,6 +33176,10 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_TMP(ZEN
        container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
        offset  = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
+       if (UNEXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) {
+               container = Z_REFVAL_P(container);
+       }
+
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
            UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
                zend_error(E_NOTICE, "Trying to get property of non-object");
@@ -35146,6 +35186,10 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_VAR(ZEN
        container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
        offset  = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
+       if (UNEXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) {
+               container = Z_REFVAL_P(container);
+       }
+
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
            UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
                zend_error(E_NOTICE, "Trying to get property of non-object");
@@ -38176,6 +38220,10 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_CV(ZEND
        container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
        offset  = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
 
+       if (UNEXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) {
+               container = Z_REFVAL_P(container);
+       }
+
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
            UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
                zend_error(E_NOTICE, "Trying to get property of non-object");