Skip to content

Commit ab11f74

Browse files
committed
Next review round
1 parent 7480341 commit ab11f74

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

Zend/zend_autoload.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ ZEND_API bool zend_autoload_unregister_class_loader(const zend_fcall_info_cache
130130
return false;
131131
}
132132

133-
ZEND_API zend_array* zend_autoload_fcc_map_to_callable_zval_map(void) {
133+
/* We do not return a HashTable* because zend_empty_array is not collectable,
134+
* therefore the zval holding this value must do so. Something that ZVAL_EMPTY_ARRAY(); does. */
135+
ZEND_API void zend_autoload_fcc_map_to_callable_zval_map(zval *return_value) {
134136
if (zend_class_autoload_functions) {
135137
zend_fcall_info_cache *fcc;
136138

@@ -140,9 +142,9 @@ ZEND_API zend_array* zend_autoload_fcc_map_to_callable_zval_map(void) {
140142
zend_get_callable_zval_from_fcc(fcc, &tmp);
141143
zend_hash_next_index_insert(map, &tmp);
142144
} ZEND_HASH_FOREACH_END();
143-
return map;
145+
RETURN_ARR(map);
144146
}
145-
return (zend_array*)&zend_empty_array;
147+
RETURN_EMPTY_ARRAY();
146148
}
147149

148150
/* Only for deprecated strange behaviour of spl_autoload_unregister() */

Zend/zend_autoload.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
ZEND_API zend_class_entry *zend_perform_class_autoload(zend_string *class_name, zend_string *lc_name);
2525
ZEND_API void zend_autoload_register_class_loader(zend_fcall_info_cache *fcc, bool prepend);
2626
ZEND_API bool zend_autoload_unregister_class_loader(const zend_fcall_info_cache *fcc);
27-
ZEND_API zend_array* zend_autoload_fcc_map_to_callable_zval_map(void);
27+
ZEND_API void zend_autoload_fcc_map_to_callable_zval_map(zval *return_value);
2828
/* Only for deprecated strange behaviour of spl_autoload_unregister() */
2929
ZEND_API void zend_autoload_clean_class_loaders(void);
3030
void zend_autoload_shutdown(void);

ext/spl/php_spl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ PHP_FUNCTION(spl_autoload_functions)
432432
{
433433
ZEND_PARSE_PARAMETERS_NONE();
434434

435-
RETURN_ARR(zend_autoload_fcc_map_to_callable_zval_map());
435+
zend_autoload_fcc_map_to_callable_zval_map(return_value);
436436
} /* }}} */
437437

438438
/* {{{ Return hash id for given object */

main/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2014,7 +2014,7 @@ void php_request_shutdown(void *dummy)
20142014
php_free_shutdown_functions();
20152015
}
20162016

2017-
/* 8. Shutdown autoloader, freeing all hold functions/closures */
2017+
/* 8. Shutdown autoloader, freeing all held functions/closures */
20182018
zend_autoload_shutdown();
20192019

20202020
/* 9. Destroy super-globals */

0 commit comments

Comments
 (0)