@@ -1887,7 +1887,7 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TS
18871887{
18881888 int name_len ;
18891889 zend_string * lcname ;
1890- //??? zend_module_entry *module_ptr;
1890+ zend_module_entry * module_ptr ;
18911891
18921892 if (!module ) {
18931893 return NULL ;
@@ -1923,13 +1923,13 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TS
19231923 lcname = STR_ALLOC (name_len , 1 );
19241924 zend_str_tolower_copy (lcname -> val , module -> name , name_len );
19251925
1926- if (zend_hash_add_mem (& module_registry , lcname , module , sizeof (zend_module_entry )) == NULL ) {
1926+ if (( module_ptr = zend_hash_add_mem (& module_registry , lcname , module , sizeof (zend_module_entry ) )) == NULL ) {
19271927 zend_error (E_CORE_WARNING , "Module '%s' already loaded" , module -> name );
19281928 STR_RELEASE (lcname );
19291929 return NULL ;
19301930 }
19311931 STR_RELEASE (lcname );
1932- //??? module = module_ptr;
1932+ module = module_ptr ;
19331933 EG (current_module ) = module ;
19341934
19351935 if (module -> functions && zend_register_functions (NULL , module -> functions , NULL , module -> type TSRMLS_CC )== FAILURE ) {
@@ -2798,7 +2798,6 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
27982798 EG (scope ) = ce_org ;
27992799 }
28002800
2801- //??? if (!zend_is_callable_check_class(Z_STRVAL_P(callable), clen, fcc, &strict_class, error TSRMLS_CC)) {
28022801 if (!zend_is_callable_check_class (Z_STR_P (callable ), fcc , & strict_class , error TSRMLS_CC )) {
28032802 EG (scope ) = last_scope ;
28042803 return 0 ;
@@ -3035,11 +3034,12 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval *object_ptr, uint ch
30353034 if (object_ptr && Z_TYPE_P (object_ptr ) != IS_OBJECT ) {
30363035 object_ptr = NULL ;
30373036 }
3038- //??? if (object_ptr &&
3039- //??? (!EG(objects_store).object_buckets ||
3040- //??? !EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(object_ptr)].valid)) {
3041- //??? return 0;
3042- //??? }
3037+
3038+ if (object_ptr &&
3039+ (!EG (objects_store ).object_buckets ||
3040+ !IS_VALID (EG (objects_store ).object_buckets [Z_OBJ_HANDLE_P (object_ptr )]))) {
3041+ return 0 ;
3042+ }
30433043
30443044 switch (Z_TYPE_P (callable )) {
30453045 case IS_STRING :
@@ -3117,10 +3117,10 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval *object_ptr, uint ch
31173117 }
31183118
31193119 } else {
3120- //??? if (!EG(objects_store).object_buckets ||
3121- //??? !EG(objects_store).object_buckets[Z_OBJ_HANDLE_PP (obj)].valid ) {
3122- //??? return 0;
3123- //??? }
3120+ if (!! EG (objects_store ).object_buckets ||
3121+ !IS_VALID ( EG (objects_store ).object_buckets [Z_OBJ_HANDLE_P (obj )]) ) {
3122+ return 0 ;
3123+ }
31243124
31253125 fcc -> calling_scope = Z_OBJCE_P (obj ); /* TBFixed: what if it's overloaded? */
31263126
@@ -3711,7 +3711,7 @@ ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *na
37113711 ZVAL_COPY_VALUE (property , value );
37123712 if (Z_REFCOUNT_P (value ) > 0 ) {
37133713 zval_copy_ctor (property );
3714- } else {
3714+ //??? } else {
37153715//??? efree(value);
37163716 }
37173717 } else {
@@ -3849,12 +3849,12 @@ ZEND_API void zend_restore_error_handling(zend_error_handling *saved TSRMLS_DC)
38493849{
38503850 EG (error_handling ) = saved -> handling ;
38513851 EG (exception_class ) = saved -> handling == EH_THROW ? saved -> exception : NULL ;
3852- if (Z_TYPE (saved -> user_handler ) != IS_UNDEF ) {
3853- //??? && saved->user_handler != EG(user_error_handler)) {
3852+ if (Z_TYPE (saved -> user_handler ) != IS_UNDEF
3853+ && memcmp ( & saved -> user_handler , & EG (user_error_handler ), sizeof ( zval )) != 0 ) {
38543854 zval_ptr_dtor (& EG (user_error_handler ));
38553855 ZVAL_COPY_VALUE (& EG (user_error_handler ), & saved -> user_handler );
3856- //??? } else if (saved->user_handler) {
3857- //??? zval_ptr_dtor(&saved->user_handler);
3856+ } else if (Z_TYPE ( saved -> user_handler ) ) {
3857+ zval_ptr_dtor (& saved -> user_handler );
38583858 }
38593859 ZVAL_UNDEF (& saved -> user_handler );
38603860}
0 commit comments