logo       

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

Subject: cvs: ZendEngine2 / zend_compile.c /tests bug34310.phpt php-src NEWS
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();

-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe