@@ -556,14 +556,11 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
556
556
Z_ADDREF_P (iterator );
557
557
}
558
558
559
- /* Instantiate object and call constructor */
560
559
zval params [2 ];
561
- ZVAL_COPY (& params [0 ], iterator ); // TODO Prevent copy?
562
- zval_ptr_dtor (iterator );
560
+ ZVAL_COPY_VALUE (& params [0 ], iterator );
563
561
ZVAL_LONG (& params [1 ], user_caching_it_flags );
564
562
zend_result is_initialized = object_init_with_constructor (& caching_it , spl_ce_RecursiveCachingIterator , 2 , params , NULL );
565
563
zval_ptr_dtor (& params [0 ]);
566
- zval_ptr_dtor (& params [1 ]);
567
564
if (is_initialized == FAILURE ) {
568
565
RETURN_THROWS ();
569
566
}
@@ -1687,12 +1684,10 @@ PHP_METHOD(RecursiveFilterIterator, getChildren)
1687
1684
1688
1685
zval childrens ;
1689
1686
zend_call_method_with_0_params (Z_OBJ (intern -> inner .zobject ), intern -> inner .ce , NULL , "getchildren" , & childrens );
1690
- if (EG (exception ) || Z_TYPE (childrens ) == IS_UNDEF ) {
1691
- zval_ptr_dtor (& childrens );
1687
+ if (Z_TYPE (childrens ) == IS_UNDEF ) {
1692
1688
RETURN_THROWS ();
1693
1689
}
1694
1690
1695
- /* Instantiate object and call constructor */
1696
1691
zend_result is_initialized = object_init_with_constructor (return_value , Z_OBJCE_P (ZEND_THIS ), 1 , & childrens , NULL );
1697
1692
zval_ptr_dtor (& childrens );
1698
1693
if (is_initialized == FAILURE ) {
@@ -1711,15 +1706,13 @@ PHP_METHOD(RecursiveCallbackFilterIterator, getChildren)
1711
1706
1712
1707
zval params [2 ];
1713
1708
zend_call_method_with_0_params (Z_OBJ (intern -> inner .zobject ), intern -> inner .ce , NULL , "getchildren" , & params [0 ]);
1714
- if (EG (exception ) || Z_TYPE (params [0 ]) == IS_UNDEF ) {
1715
- zval_ptr_dtor (& params [0 ]);
1709
+ if (Z_TYPE (params [0 ]) == IS_UNDEF ) {
1716
1710
RETURN_THROWS ();
1717
1711
}
1718
1712
1719
1713
/* Get callable to pass to the constructor */
1720
1714
zend_get_callable_zval_from_fcc (& intern -> u .callback_filter , & params [1 ]);
1721
1715
1722
- /* Instantiate object and call constructor */
1723
1716
zend_result is_initialized = object_init_with_constructor (return_value , Z_OBJCE_P (ZEND_THIS ), 2 , params , NULL );
1724
1717
zval_ptr_dtor (& params [0 ]);
1725
1718
zval_ptr_dtor (& params [1 ]);
@@ -1988,17 +1981,16 @@ PHP_METHOD(RecursiveRegexIterator, getChildren)
1988
1981
}
1989
1982
1990
1983
zval args [5 ];
1991
- args [0 ] = retval ;
1984
+ ZVAL_COPY_VALUE ( & args [0 ], & retval ) ;
1992
1985
ZVAL_STR_COPY (& args [1 ], intern -> u .regex .regex );
1993
1986
ZVAL_LONG (& args [2 ], intern -> u .regex .mode );
1994
1987
ZVAL_LONG (& args [3 ], intern -> u .regex .flags );
1995
1988
ZVAL_LONG (& args [4 ], intern -> u .regex .preg_flags );
1996
1989
1997
- /* Instantiate object and call constructor */
1998
1990
zend_result is_initialized = object_init_with_constructor (return_value , Z_OBJCE_P (ZEND_THIS ), 5 , args , NULL );
1999
1991
2000
1992
zval_ptr_dtor (& args [0 ]);
2001
- zval_ptr_dtor (& args [1 ]);
1993
+ zval_ptr_dtor_str (& args [1 ]);
2002
1994
if (is_initialized == FAILURE ) {
2003
1995
RETURN_THROWS ();
2004
1996
}
@@ -2300,7 +2292,6 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern)
2300
2292
} else {
2301
2293
ZVAL_LONG (& args [1 ], intern -> u .caching .flags & CIT_PUBLIC );
2302
2294
2303
- /* Instantiate object and call constructor */
2304
2295
zend_result is_initialized = object_init_with_constructor (
2305
2296
& intern -> u .caching .zchildren ,
2306
2297
spl_ce_RecursiveCachingIterator ,
0 commit comments