diff options
author | Andi Gutmans <andi@php.net> | 2000-07-06 22:08:22 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2000-07-06 22:08:22 +0000 |
commit | 5f893e68ff1a3c07927bd3ad70f4ab54cd4a08f7 (patch) | |
tree | c7acd9a9830d21b2e12d1d4db2742a54c354235c /Zend/zend_execute.c | |
parent | 4aef5ef83055780782e76e33371821112590a8aa (diff) | |
download | php-git-5f893e68ff1a3c07927bd3ad70f4ab54cd4a08f7.tar.gz |
- Complex fix for solving a problem with objects & method calls.
- Previous version is tagged PRE_METHOD_CALL_SEPERATE_FIX_PATCH.
- I need to check this fix on a server so if it doesn't work I will revert
- it.
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r-- | Zend/zend_execute.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index c3a08c2735..7918e97e22 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -65,12 +65,13 @@ static void zend_extension_statement_handler(zend_extension *extension, zend_op_ static void zend_extension_fcall_begin_handler(zend_extension *extension, zend_op_array *op_array); static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_array *op_array); - +/* #define SEPARATE_ON_READ_OBJECT(obj, _type) \ if ((obj) && ((_type) == BP_VAR_R) && ((*(obj))->type == IS_OBJECT)) { \ SEPARATE_ZVAL_IF_NOT_REF((obj)); \ (*(obj))->is_ref = 1; \ } +*/ #define RETURN_VALUE_USED(opline) (!((opline)->result.u.EA.type & EXT_TYPE_UNUSED)) @@ -502,7 +503,7 @@ static void zend_fetch_var_address(znode *result, znode *op1, znode *op2, temp_v zval_dtor(varname); } Ts[result->u.var].var.ptr_ptr = retval; - SEPARATE_ON_READ_OBJECT(retval, type); +// SEPARATE_ON_READ_OBJECT(retval, type); SELECTIVE_PZVAL_LOCK(*retval, result); } @@ -680,7 +681,7 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2, } else { *retval = zend_fetch_dimension_address_inner(container->value.ht, op2, Ts, type ELS_CC); } - SEPARATE_ON_READ_OBJECT(*retval, type); + //SEPARATE_ON_READ_OBJECT(*retval, type); SELECTIVE_PZVAL_LOCK(**retval, result); break; case IS_NULL: @@ -871,7 +872,7 @@ static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, t zendi_zval_copy_ctor(*container); } *retval = zend_fetch_property_address_inner(container->value.obj.properties, op2, Ts, type ELS_CC); - SEPARATE_ON_READ_OBJECT(*retval, type); + //SEPARATE_ON_READ_OBJECT(*retval, type); SELECTIVE_PZVAL_LOCK(**retval, result); } @@ -1513,6 +1514,10 @@ binary_assign_op_addr: { if (!object.ptr || object.ptr->type != IS_OBJECT) { zend_error(E_ERROR, "Call to a member function on a non-object"); } + if (!object.ptr->is_ref && object.ptr->refcount > 1) { + zend_error(E_ERROR, "Bug: Problem in method call\n"); + } + object.ptr->is_ref=1; object.ptr->refcount++; /* For $this pointer */ active_function_table = &(object.ptr->value.obj.ce->function_table); } |