cvs: ZendEngine2(PHP_5_1) / zend_compile.c /tests bug34310.phpt php-src NEWS
| From: | Dmitry Stogov | Date: | Thu, 01 Sep 2005 10:54:38 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_1) / 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-4089@lists.php.net to get a copy of this message | ||
dmitry Thu Sep 1 06:54:38 2005 EDT
Modified files: (Branch: PHP_5_1)
/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.2027.2.38&r2=1.2027.2.39&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.38 php-src/NEWS:1.2027.2.39
--- php-src/NEWS:1.2027.2.38 Thu Sep 1 06:05:29 2005
+++ php-src/NEWS Thu Sep 1 06:54:33 2005
@@ -18,6 +18,7 @@
- Fixed "make test" to work for phpized extensions. (Hartmut, Jani)
- Fixed failing queries (FALSE returned) with mysqli_query() on 64 bit systems.
(Andrey)
+- Fixed bug #34310 (foreach($arr as $c->d => $x) crashes). (Dmitry)
- Fixed bug #34306 (wddx_serialize_value() crashes with long array keys). (Jani)
- Fixed bug #34302 (date('W') do not return leading zeros for week 1 to 9).
(Derick)
http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?r1=1.647.2.2&r2=1.647.2.3&ty=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.647.2.2 ZendEngine2/zend_compile.c:1.647.2.3
--- ZendEngine2/zend_compile.c:1.647.2.2 Thu Sep 1 06:05:32 2005
+++ ZendEngine2/zend_compile.c Thu Sep 1 06:54:36 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.647.2.2 2005/09/01 10:05:32 dmitry Exp $ */
+/* $Id: zend_compile.c,v 1.647.2.3 2005/09/01 10:54:36 dmitry Exp $ */
#include <zend_language_parser.h>
#include "zend.h"
@@ -543,14 +543,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.1.2.1&r2=1.1.2.2&ty=u
Index: ZendEngine2/tests/bug34310.phpt
diff -u ZendEngine2/tests/bug34310.phpt:1.1.2.1 ZendEngine2/tests/bug34310.phpt:1.1.2.2
--- ZendEngine2/tests/bug34310.phpt:1.1.2.1 Wed Aug 31 05:16:24 2005
+++ ZendEngine2/tests/bug34310.phpt Thu Sep 1 06:54:38 2005
@@ -5,7 +5,7 @@
class C
{
- var $d;
+ public $d;
}
$c = new C();