Skip to content

Commit ea43624

Browse files
committed
Fix wrong size calculation related to function name
It would be nice if we could drop this manual function name reuse code altogether and rely on interning for it.
1 parent d3c4841 commit ea43624

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

ext/opcache/zend_persist_calc.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,11 @@ static void zend_persist_op_array_calc_ex(zend_op_array *op_array)
192192

193193
if (op_array->function_name) {
194194
zend_string *old_name = op_array->function_name;
195-
zend_string *new_name = zend_shared_alloc_get_xlat_entry(old_name);
196-
197-
if (new_name) {
198-
op_array->function_name = new_name;
199-
} else {
195+
if (!zend_shared_alloc_get_xlat_entry(old_name)) {
200196
ADD_INTERNED_STRING(op_array->function_name);
201-
zend_shared_alloc_register_xlat_entry(old_name, op_array->function_name);
197+
if (!zend_shared_alloc_get_xlat_entry(op_array->function_name)) {
198+
zend_shared_alloc_register_xlat_entry(old_name, op_array->function_name);
199+
}
202200
}
203201
}
204202

0 commit comments

Comments
 (0)