cvs: ZendEngine2 / zend_compile.c /tests bug34310.phpt php-src NEWS

From: Date: Thu, 01 Sep 2005 10:55:06 +0000
Subject: cvs: ZendEngine2 / zend_compile.c /tests bug34310.phpt php-src NEWS
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-4090@lists.php.net to get a copy of this message
dmitry Thu Sep 1 06:55:06 2005 EDT Modified files: /php-src NEWS /ZendEngine2 zend_compile.c /ZendEngine2/tests bug34310.phpt Log: Fixed bug #34310 (foreach($arr as $c->d => $x) crashes) http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2052&r2=1.2053&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.2052 php-src/NEWS:1.2053 --- php-src/NEWS:1.2052 Thu Sep 1 06:04:51 2005 +++ php-src/NEWS Thu Sep 1 06:55:05 2005 @@ -19,6 +19,7 @@ defined using reflection API. (Johannes) - Fixed a bug where stream_get_meta_data() did not return the "uri" element for files opened with tmpname(). (Derick) +- Fixed bug #34310 (foreach($arr as $c->d => $x) crashes). (Dmitry) - Fixed bug #34302 (date('W') do not return leading zeros for week 1 to 9). (Derick) - Fixed bug #33957 (gmdate('W')/date('W') sometimes returns wrong week number). http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?r1=1.660&r2=1.661&ty=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.660 ZendEngine2/zend_compile.c:1.661 --- ZendEngine2/zend_compile.c:1.660 Thu Sep 1 06:04:57 2005 +++ ZendEngine2/zend_compile.c Thu Sep 1 06:55:05 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.660 2005/09/01 10:04:57 dmitry Exp $ */ +/* $Id: zend_compile.c,v 1.661 2005/09/01 10:55:05 dmitry Exp $ */ #include <zend_language_parser.h> #include "zend.h" @@ -572,14 +572,20 @@ if (last_op_number > 0) { zend_op *last_op = &CG(active_op_array)->opcodes[last_op_number-1]; - if (last_op->opcode == ZEND_FETCH_OBJ_W) { + if (variable->op_type == IS_VAR && + last_op->opcode == ZEND_FETCH_OBJ_W && + last_op->result.op_type == IS_VAR && + last_op->result.u.var == variable->u.var) { last_op->opcode = ZEND_ASSIGN_OBJ; zend_do_op_data(opline, value TSRMLS_CC); SET_UNUSED(opline->result); *result = last_op->result; return; - } else if (last_op->opcode == ZEND_FETCH_DIM_W) { + } else if (variable->op_type == IS_VAR && + last_op->opcode == ZEND_FETCH_DIM_W && + last_op->result.op_type == IS_VAR && + last_op->result.u.var == variable->u.var) { last_op->opcode = ZEND_ASSIGN_DIM; zend_do_op_data(opline, value TSRMLS_CC); http://cvs.php.net/diff.php/ZendEngine2/tests/bug34310.phpt?r1=1.2&r2=1.3&ty=u Index: ZendEngine2/tests/bug34310.phpt diff -u ZendEngine2/tests/bug34310.phpt:1.2 ZendEngine2/tests/bug34310.phpt:1.3 --- ZendEngine2/tests/bug34310.phpt:1.2 Wed Aug 31 05:16:50 2005 +++ ZendEngine2/tests/bug34310.phpt Thu Sep 1 06:55:05 2005 @@ -5,7 +5,7 @@ class C { - var $d; + public $d; } $c = new C();

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