diff options
Diffstat (limited to 'Zend/zend_vm_execute.h')
-rw-r--r-- | Zend/zend_vm_execute.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 0307dae99..51e18469e 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -2122,7 +2122,7 @@ static int ZEND_UNSET_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { zend_op *opline = EX(opline); - zend_free_op free_op1; + zval *array_ptr, **array_ptr_ptr; HashTable *fe_ht; zend_object_iterator *iter = NULL; @@ -2169,11 +2169,9 @@ static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) array_ptr->refcount++; } } else { - if (IS_CONST == IS_VAR && - free_op1.var == NULL && + if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && !array_ptr->is_ref && array_ptr->refcount > 1) { - /* non-separated return value from function */ zval *tmp; ALLOC_ZVAL(tmp); @@ -2694,7 +2692,11 @@ static int ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS ce = EX_T(opline->op1.u.var).class_entry; if (zend_hash_find(&ce->constants_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, (void **) &value) == SUCCESS) { + zend_class_entry *old_scope = EG(scope); + + EG(scope) = ce; zval_update_constant(value, (void *) 1 TSRMLS_CC); + EG(scope) = old_scope; EX_T(opline->result.u.var).tmp_var = **value; zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); } else { @@ -4733,11 +4735,9 @@ static int ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) array_ptr->refcount++; } } else { - if (IS_TMP_VAR == IS_VAR && - free_op1.var == NULL && + if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && !array_ptr->is_ref && array_ptr->refcount > 1) { - /* non-separated return value from function */ zval *tmp; ALLOC_ZVAL(tmp); @@ -7873,11 +7873,9 @@ static int ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) array_ptr->refcount++; } } else { - if (IS_VAR == IS_VAR && - free_op1.var == NULL && + if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && !array_ptr->is_ref && array_ptr->refcount > 1) { - /* non-separated return value from function */ zval *tmp; ALLOC_ZVAL(tmp); @@ -15486,7 +15484,11 @@ static int ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG ce = EX_T(opline->op1.u.var).class_entry; if (zend_hash_find(&ce->constants_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, (void **) &value) == SUCCESS) { + zend_class_entry *old_scope = EG(scope); + + EG(scope) = ce; zval_update_constant(value, (void *) 1 TSRMLS_CC); + EG(scope) = old_scope; EX_T(opline->result.u.var).tmp_var = **value; zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); } else { @@ -19887,7 +19889,7 @@ static int ZEND_UNSET_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { zend_op *opline = EX(opline); - zend_free_op free_op1; + zval *array_ptr, **array_ptr_ptr; HashTable *fe_ht; zend_object_iterator *iter = NULL; @@ -19934,11 +19936,9 @@ static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) array_ptr->refcount++; } } else { - if (IS_CV == IS_VAR && - free_op1.var == NULL && + if ((IS_CV == IS_CV || IS_CV == IS_VAR) && !array_ptr->is_ref && array_ptr->refcount > 1) { - /* non-separated return value from function */ zval *tmp; ALLOC_ZVAL(tmp); @@ -26569,7 +26569,7 @@ static int ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } -void zend_init_opcodes_handlers() +void zend_init_opcodes_handlers(void) { static const opcode_handler_t labels[] = { ZEND_NOP_SPEC_HANDLER, |