cvs: Zend(PHP_4_3) / zend_execute.c

From: Date: Tue, 17 Jun 2003 15:39:22 +0000
Subject: cvs: Zend(PHP_4_3) / zend_execute.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-1387@lists.php.net to get a copy of this message
stas Tue Jun 17 11:39:22 2003 EDT Modified files: (Branch: PHP_4_3) /Zend zend_execute.c Log: MFZE2: Fix bug #22592 - cascading assignments to string offsets Index: Zend/zend_execute.c diff -u Zend/zend_execute.c:1.316.2.11 Zend/zend_execute.c:1.316.2.12 --- Zend/zend_execute.c:1.316.2.11 Fri May 30 21:37:43 2003 +++ Zend/zend_execute.c Tue Jun 17 11:39:22 2003 @@ -375,7 +375,16 @@ if (op2) { if (op2->op_type == IS_VAR) { if (value == &Ts[op2->u.var].tmp_var) { - STR_FREE(value->value.str.val); + if(result->u.EA.type & EXT_TYPE_UNUSED) { + /* We are not going to use return value, drop it */ + STR_FREE(value->value.str.val); + } else { + /* We are going to use return value, make it real zval */ + ALLOC_ZVAL(value); + *value = Ts[op2->u.var].tmp_var; + value->is_ref = 0; + value->refcount = 0; /* LOCK will increase it */ + } } } else { if (final_value == &Ts[op2->u.var].tmp_var) { @@ -400,7 +409,8 @@ break; EMPTY_SWITCH_DEFAULT_CASE() } - Ts[result->u.var].var.ptr_ptr = &EG(uninitialized_zval_ptr); + /* Ts[result->u.var].var.ptr_ptr = &EG(uninitialized_zval_ptr); */ + Ts[result->u.var].var.ptr_ptr = &value; SELECTIVE_PZVAL_LOCK(*Ts[result->u.var].var.ptr_ptr, result); AI_USE_PTR(Ts[result->u.var].var); return;

« previous php.zend-engine.cvs (#1387) next »