summaryrefslogtreecommitdiff
path: root/Zend/zend_opcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r--Zend/zend_opcode.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 1719094e9a..438feb4c91 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -110,6 +110,23 @@ ZEND_API void destroy_zend_function(zend_function *function)
ZEND_ASSERT(function->type == ZEND_INTERNAL_FUNCTION);
ZEND_ASSERT(function->common.function_name);
zend_string_release(function->common.function_name);
+
+ if (function->common.arg_info &&
+ (function->common.fn_flags & (ZEND_ACC_HAS_RETURN_TYPE|ZEND_ACC_HAS_TYPE_HINTS))) {
+ uint32_t i;
+ uint32_t num_args = function->common.num_args + 1;
+ zend_arg_info *arg_info = function->common.arg_info - 1;
+
+ if (function->common.fn_flags & ZEND_ACC_VARIADIC) {
+ num_args++;
+ }
+ for (i = 0 ; i < num_args; i++) {
+ if (ZEND_TYPE_IS_CLASS(arg_info[i].type)) {
+ zend_string_release(ZEND_TYPE_NAME(arg_info[i].type));
+ }
+ }
+ free(arg_info);
+ }
}
}
@@ -433,8 +450,8 @@ ZEND_API void destroy_op_array(zend_op_array *op_array)
if (arg_info[i].name) {
zend_string_release(arg_info[i].name);
}
- if (arg_info[i].class_name) {
- zend_string_release(arg_info[i].class_name);
+ if (ZEND_TYPE_IS_CLASS(arg_info[i].type)) {
+ zend_string_release(ZEND_TYPE_NAME(arg_info[i].type));
}
}
efree(arg_info);