?? ??? 2011, PHP 5.3.9
- Core:
+ . Fixed bug #60138 (GC crash with referenced array in RecursiveArrayIterator)
+ (Dmitry).
. Fixed bug #60099 (__halt_compiler() works in braced namespaces). (Felipe)
. Fixed bug #55874 (GCC does not provide __sync_fetch_and_add on some archs).
(klightspeed at netspace dot net dot au)
--- /dev/null
+--TEST--
+Bug #60138 (GC crash with referenced array in RecursiveArrayIterator)
+--FILE--
+<?php
+$tree = array(array("f"));
+$category =& $tree[0];
+
+$iterator = new RecursiveIteratorIterator(
+ new RecursiveArrayIterator($tree),
+ RecursiveIteratorIterator::SELF_FIRST
+);
+foreach($iterator as $file);
+echo "ok\n";
+?>
+--EXPECT--
+ok
&& (EX(function_state).function->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) == 0
&& !ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)
&& PZVAL_IS_REF(*fci->params[i])) {
- SEPARATE_ZVAL(fci->params[i]);
- }
-
- if (ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)
+ ALLOC_ZVAL(param);
+ *param = **(fci->params[i]);
+ INIT_PZVAL(param);
+ zval_copy_ctor(param);
+ } else if (ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)
&& !PZVAL_IS_REF(*fci->params[i])) {
if (Z_REFCOUNT_PP(fci->params[i]) > 1) {