diff options
author | Dmitry Stogov <dmitry@zend.com> | 2015-09-29 13:31:47 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2015-09-29 13:31:47 +0300 |
commit | ca36b7bc1395b6daff56082d1c91229c3e77069a (patch) | |
tree | 6b278ee5f24021679602da2f253f9c1cdcd10bca | |
parent | 5531d4492e17e90e9d06d48944024bf102017223 (diff) | |
download | php-git-ca36b7bc1395b6daff56082d1c91229c3e77069a.tar.gz |
Added zend_internal_function.reserved[] fields, to allow extensions keep additional associated information.
We didn't have zend_internal_function.reserved[] in PHP5, but we always allocated space for zend_function union, and extensions were able to reuse zend_function.op_array.reserved[] even for internal function. Now this is not possible. And extensions have to use zend_function.op_array.reserved[] for user functions and zend_function.internal_function.reserved[] for internal.
-rw-r--r-- | Zend/zend_API.c | 1 | ||||
-rw-r--r-- | Zend/zend_compile.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index d72738eddb..5a488f7e9d 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2123,6 +2123,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio } internal_function->type = ZEND_INTERNAL_FUNCTION; internal_function->module = EG(current_module); + memset(internal_function->reserved, 0, ZEND_MAX_RESERVED_RESOURCES * sizeof(void*)); if (scope) { class_name_len = ZSTR_LEN(scope->name); diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index ee4fbe5a73..f6283fb5c9 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -396,6 +396,7 @@ typedef struct _zend_internal_function { void (*handler)(INTERNAL_FUNCTION_PARAMETERS); struct _zend_module_entry *module; + void *reserved[ZEND_MAX_RESERVED_RESOURCES]; } zend_internal_function; #define ZEND_FN_SCOPE_NAME(function) ((function) && (function)->common.scope ? ZSTR_VAL((function)->common.scope->name) : "") |