Skip to content

Commit 168ec3a

Browse files
committed
Fixed ZTS build (disable deallocation of arg_info of internal functions with type hints)
1 parent a84608d commit 168ec3a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Zend/zend_opcode.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ ZEND_API void zend_function_dtor(zval *zv)
142142
ZEND_ASSERT(function->type == ZEND_INTERNAL_FUNCTION);
143143
ZEND_ASSERT(function->common.function_name);
144144
zend_string_release(function->common.function_name);
145+
#ifndef ZTS
145146
if ((function->common.fn_flags & (ZEND_ACC_HAS_RETURN_TYPE|ZEND_ACC_HAS_TYPE_HINTS)) &&
146147
!function->common.scope && function->common.arg_info) {
147148

@@ -159,6 +160,7 @@ ZEND_API void zend_function_dtor(zval *zv)
159160
}
160161
free(arg_info);
161162
}
163+
#endif
162164
if (!(function->common.fn_flags & ZEND_ACC_ARENA_ALLOCATED)) {
163165
pefree(function, 1);
164166
}
@@ -244,7 +246,9 @@ ZEND_API void destroy_zend_class(zval *zv)
244246
{
245247
zend_property_info *prop_info;
246248
zend_class_entry *ce = Z_PTR_P(zv);
249+
#ifndef ZTS
247250
zend_function *fn;
251+
#endif
248252

249253
if (--ce->refcount > 0) {
250254
return;
@@ -328,13 +332,15 @@ ZEND_API void destroy_zend_class(zval *zv)
328332
}
329333
zend_hash_destroy(&ce->properties_info);
330334
zend_string_release(ce->name);
335+
#ifndef ZTS
331336
ZEND_HASH_FOREACH_PTR(&ce->function_table, fn) {
332337
if ((fn->common.fn_flags & (ZEND_ACC_HAS_RETURN_TYPE|ZEND_ACC_HAS_TYPE_HINTS)) &&
333338
fn->common.scope == ce) {
334339
/* reset function scope to allow arg_info removing */
335340
fn->common.scope = NULL;
336341
}
337342
} ZEND_HASH_FOREACH_END();
343+
#endif
338344
zend_hash_destroy(&ce->function_table);
339345
if (zend_hash_num_elements(&ce->constants_table)) {
340346
zend_class_constant *c;

0 commit comments

Comments
 (0)