com php-src: Added zend_internal_function.reserved[] fields, to allow extensions keep additional as sociated information. We didn't have zend_inter
nal_function.reserved[] in PHP5, but we a lways allocated space for zend_function union, and extensions were able to reuse zend_function
.op_array.reserved[] even for internal functi on. Now this is not possible. And extensions have to use zend_function.op_array.reserved[ ] for user
functions and zend_funct
| From: | Dmitry Stogov | Date: | Tue, 29 Sep 2015 10:31:47 +0000 |
| Subject: | com php-src: Added zend_internal_function.reserved[] fields, to allow extensions keep additional as sociated information. We didn't have zend_inter nal_function.reserved[] in PHP5, but we a lways allocated space for zend_function union, and extensions were able to reuse zend_function .op_array.reserved[] even for internal functi on. Now this is not possible. And extensions have to use zend_function.op_array.reserved[ ] for user functions and zend_funct |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89209@lists.php.net to get a copy of this message | ||
Commit: ca36b7bc1395b6daff56082d1c91229c3e77069a
Author: Dmitry Stogov <dmitry@zend.com> Tue, 29 Sep 2015 13:31:47 +0300
Parents: 5531d4492e17e90e9d06d48944024bf102017223
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ca36b7bc1395b6daff56082d1c91229c3e77069a
Log:
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.
Changed paths:
M Zend/zend_API.c
M Zend/zend_compile.h
Diff:
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index d72738e..5a488f7 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 ee4fbe5..f6283fb 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) : "")