cvs: ZendEngine2 / zend_compile.c /tests bug38469.phpt
[email protected] ("Arnaud Le Blanc")
| Newsgroups | php.zend-engine.cvs |
|---|---|
| Message-ID | <cvslbarnaud1227472480@cvsserver> |
lbarnaud Sun Nov 23 20:34:40 2008 UTC
Modified files:
/ZendEngine2 zend_compile.c
/ZendEngine2/tests bug38469.phpt
Log:
Fixed bug #46649 (Setting array element with that same array produces
inconsistent results)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.842&r2=1.843&diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.842 ZendEngine2/zend_compile.c:1.843
--- ZendEngine2/zend_compile.c:1.842 Mon Nov 3 19:27:48 2008
+++ ZendEngine2/zend_compile.c Sun Nov 23 20:34:40 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.842 2008/11/03 19:27:48 johannes Exp $ */
+/* $Id: zend_compile.c,v 1.843 2008/11/23 20:34:40 lbarnaud Exp $ */
#include <zend_language_parser.h>
#include "zend.h"
@@ -635,6 +635,7 @@
CG(active_op_array)->vars[value->u.var].name,
CG(active_op_array)->vars[value->u.var].name_len, 1);
SET_UNUSED(opline->op2);
+ opline->op2.u.EA.type = ZEND_FETCH_LOCAL;
value = &opline->result;
}
}
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug38469.phpt?r1=1.4&r2=1.5&diff_format=u
Index: ZendEngine2/tests/bug38469.phpt
diff -u ZendEngine2/tests/bug38469.phpt:1.4 ZendEngine2/tests/bug38469.phpt:1.5
--- ZendEngine2/tests/bug38469.phpt:1.4 Sat May 24 15:13:08 2008
+++ ZendEngine2/tests/bug38469.phpt Sun Nov 23 20:34:40 2008
@@ -8,6 +8,16 @@
$b = array(array());
$b[0][0] = $b;
var_dump($b);
+
+function f() {
+ $a = array();
+ $a[0] = $a;
+ var_dump($a);
+ $b = array(array());
+ $b[0][0] = $b;
+ var_dump($b);
+}
+f();
?>
--EXPECT--
array(1) {
@@ -26,3 +36,19 @@
}
}
}
+array(1) {
+ [0]=>
+ array(0) {
+ }
+}
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(0) {
+ }
+ }
+ }
+}