cvs: ZendEngine2 / zend_execute.c

From: Date: Mon, 16 Jun 2003 15:41:03 +0000
Subject: cvs: ZendEngine2 / zend_execute.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-1381@lists.php.net to get a copy of this message
stas Mon Jun 16 11:41:03 2003 EDT Modified files: /ZendEngine2 zend_execute.c Log: Fix bug #22592 - cascading assignments to string offsets Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.473 ZendEngine2/zend_execute.c:1.474 --- ZendEngine2/zend_execute.c:1.473 Tue Jun 10 16:03:24 2003 +++ ZendEngine2/zend_execute.c Mon Jun 16 11:41:02 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.c,v 1.473 2003/06/10 20:03:24 imajes Exp $ */ +/* $Id: zend_execute.c,v 1.474 2003/06/16 15:41:02 stas Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -470,7 +470,16 @@ if (op2) { if (op2->op_type == IS_VAR) { if (value == &T(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_INIT_ZVAL(value); + *value = T(op2->u.var).tmp_var; + value->is_ref = 0; + value->refcount = 0; /* LOCK will increase it */ + } } } else { if (final_value == &T(op2->u.var).tmp_var) { @@ -495,7 +504,8 @@ break; EMPTY_SWITCH_DEFAULT_CASE() } - T(result->u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); +/* T(result->u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); */ + T(result->u.var).var.ptr_ptr = &value; SELECTIVE_PZVAL_LOCK(*T(result->u.var).var.ptr_ptr, result); AI_USE_PTR(T(result->u.var).var); return;

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