@@ -603,8 +603,10 @@ static int timecop_func_override(TSRMLS_D)
603603 function_add_ref (zf_orig );
604604
605605#if PHP_MAJOR_VERSION >= 7
606+ GUARD_FUNCTION_ARG_INFO_BEGIN (zf_orig );
606607 zend_hash_str_update_mem (EG (function_table ), p -> orig_func , strlen (p -> orig_func ),
607608 zf_ovrd , sizeof (zend_internal_function ));
609+ GUARD_FUNCTION_ARG_INFO_END ();
608610#else
609611 zend_hash_update (EG (function_table ), p -> orig_func , strlen (p -> orig_func )+ 1 ,
610612 zf_ovrd , sizeof (zend_function ), NULL );
@@ -764,23 +766,29 @@ static int timecop_class_override(TSRMLS_D)
764766static int timecop_func_override_clear (TSRMLS_D )
765767{
766768 const struct timecop_override_func_entry * p ;
767- zend_function * zf_orig ;
769+ zend_function * zf_orig , * zf_ovld ;
768770
769771 p = & (timecop_override_func_table [0 ]);
770772 while (p -> orig_func != NULL ) {
771773#if PHP_MAJOR_VERSION >= 7
772774 zf_orig = zend_hash_str_find_ptr (EG (function_table ),
773775 p -> save_func , strlen (p -> save_func ));
774- if (zf_orig == NULL ) {
776+ zf_ovld = zend_hash_str_find_ptr (EG (function_table ),
777+ p -> orig_func , strlen (p -> orig_func ));
778+
779+ if (zf_orig == NULL || zf_ovld == NULL ) {
775780 p ++ ;
776781 continue ;
777782 }
778783
784+ GUARD_FUNCTION_ARG_INFO_BEGIN (zf_ovld );
779785 zend_hash_str_update_mem (EG (function_table ), p -> orig_func , strlen (p -> orig_func ),
780786 zf_orig , sizeof (zend_internal_function ));
787+ GUARD_FUNCTION_ARG_INFO_END ();
781788 function_add_ref (zf_orig );
782-
789+ GUARD_FUNCTION_ARG_INFO_BEGIN ( zf_orig );
783790 zend_hash_str_del (EG (function_table ), p -> save_func , strlen (p -> save_func ));
791+ GUARD_FUNCTION_ARG_INFO_END ();
784792#else
785793 if (zend_hash_find (EG (function_table ), p -> save_func , strlen (p -> save_func )+ 1 ,
786794 (void * * )& zf_orig ) != SUCCESS ) {
0 commit comments