Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_execute.c
| From: | Andi Gutmans | Date: | Fri, 05 Mar 2004 12:50:30 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_compile.c zend_execute.c | ||
| References: | 1 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-2449@lists.php.net to get a copy of this message | ||
Should be fixed now.
At 02:41 PM 2/29/2004 -0500, Rob Richards wrote:
The Fix leak in foreach ($o->mthd()->arr) change: http://news.php.net/article.php?group=php.zend-engine.cvs&article=2409 seems to break nested foreach loops when using iterators. They work fine without this change. $xml_mem = simplexml_load_string('<bookbody><part><chapter><page>1</page></chapter></part></bookbody>'); /* The following works fine */ foreach ($xml_mem->part as $part) { foreach($part->chapter->page as $page) { print $page; } } /* The following segfaults */ foreach ($xml_mem->part as $part) { foreach($part->chapter as $chapter) { // Difference here from previous example print $chapter; } } In the example that segfaults, $part is now getting dtor'd an additional time. When it hits the outer loop, it has already been destroyed and now segfaults when it accesses the current $part when trying to move next. The same thing happens in the dom extension as well. Rob