]> granicus.if.org Git - php/commitdiff
Fixed IS_REFERENCE support
authorDmitry Stogov <dmitry@zend.com>
Fri, 28 Feb 2014 08:54:38 +0000 (12:54 +0400)
committerDmitry Stogov <dmitry@zend.com>
Fri, 28 Feb 2014 08:54:38 +0000 (12:54 +0400)
Zend/zend_API.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index 32f60dc2327f03ba12883b365ea301fc28f35b51..8cd3462932387e04d018e029e12489b755582306 100644 (file)
@@ -1125,6 +1125,11 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destro
 
 static int zval_update_class_constant(zval *pp, int is_static, int offset TSRMLS_DC) /* {{{ */
 {
+//     zval *p = pp;
+
+       if (Z_TYPE_P(pp) == IS_REFERENCE) {
+               pp = Z_REFVAL_P(pp);
+       }
        if (IS_CONSTANT_TYPE(Z_TYPE_P(pp))) {
                zend_class_entry **scope = EG(in_execution)?&EG(scope):&CG(active_class_entry);
 
index 92071878ddab242b33393647c7343c49ccaaeab8..1279f2382c482747877d3d68f53070bc8c634aa8 100644 (file)
@@ -4585,6 +4585,9 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|
        container = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_IS);
        offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
 
+       if (Z_TYPE_P(container) == IS_REFERENCE) {
+               container = Z_REFVAL_P(container);
+       }
        if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
                HashTable *ht;
                int isset = 0;
index 9a461f5c1194c90aa95086219b83fba88b38e237..f209c1244a09d1c8523e35529b60a3b8667f1500 100644 (file)
@@ -15759,6 +15759,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(
        container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
        offset = opline->op2.zv;
 
+       if (Z_TYPE_P(container) == IS_REFERENCE) {
+               container = Z_REFVAL_P(container);
+       }
        if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
                HashTable *ht;
                int isset = 0;
@@ -17774,6 +17777,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(in
        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 (Z_TYPE_P(container) == IS_REFERENCE) {
+               container = Z_REFVAL_P(container);
+       }
        if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
                HashTable *ht;
                int isset = 0;
@@ -20183,6 +20189,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(in
        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 (Z_TYPE_P(container) == IS_REFERENCE) {
+               container = Z_REFVAL_P(container);
+       }
        if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
                HashTable *ht;
                int isset = 0;
@@ -23372,6 +23381,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(int
        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 (Z_TYPE_P(container) == IS_REFERENCE) {
+               container = Z_REFVAL_P(container);
+       }
        if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
                HashTable *ht;
                int isset = 0;
@@ -24815,6 +24827,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CON
        container = _get_obj_zval_ptr_unused(TSRMLS_C);
        offset = opline->op2.zv;
 
+       if (Z_TYPE_P(container) == IS_REFERENCE) {
+               container = Z_REFVAL_P(container);
+       }
        if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
                HashTable *ht;
                int isset = 0;
@@ -26090,6 +26105,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_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 (Z_TYPE_P(container) == IS_REFERENCE) {
+               container = Z_REFVAL_P(container);
+       }
        if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
                HashTable *ht;
                int isset = 0;
@@ -27365,6 +27383,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_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 (Z_TYPE_P(container) == IS_REFERENCE) {
+               container = Z_REFVAL_P(container);
+       }
        if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
                HashTable *ht;
                int isset = 0;
@@ -29040,6 +29061,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_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 (Z_TYPE_P(container) == IS_REFERENCE) {
+               container = Z_REFVAL_P(container);
+       }
        if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
                HashTable *ht;
                int isset = 0;
@@ -32465,6 +32489,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(i
        container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
        offset = opline->op2.zv;
 
+       if (Z_TYPE_P(container) == IS_REFERENCE) {
+               container = Z_REFVAL_P(container);
+       }
        if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
                HashTable *ht;
                int isset = 0;
@@ -34355,6 +34382,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(int
        container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
        offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
+       if (Z_TYPE_P(container) == IS_REFERENCE) {
+               container = Z_REFVAL_P(container);
+       }
        if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
                HashTable *ht;
                int isset = 0;
@@ -36639,6 +36669,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int
        container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
        offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
+       if (Z_TYPE_P(container) == IS_REFERENCE) {
+               container = Z_REFVAL_P(container);
+       }
        if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
                HashTable *ht;
                int isset = 0;
@@ -39572,6 +39605,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(int
        container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
        offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
 
+       if (Z_TYPE_P(container) == IS_REFERENCE) {
+               container = Z_REFVAL_P(container);
+       }
        if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
                HashTable *ht;
                int isset = 0;