From ea43624972b51c367614c62257bda09a90f1d76f Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 5 Jul 2019 10:44:48 +0200 Subject: [PATCH] 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. --- ext/opcache/zend_persist_calc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c index a38398e3cf..cc798b27de 100644 --- a/ext/opcache/zend_persist_calc.c +++ b/ext/opcache/zend_persist_calc.c @@ -192,13 +192,11 @@ static void zend_persist_op_array_calc_ex(zend_op_array *op_array) if (op_array->function_name) { zend_string *old_name = op_array->function_name; - zend_string *new_name = zend_shared_alloc_get_xlat_entry(old_name); - - if (new_name) { - op_array->function_name = new_name; - } else { + if (!zend_shared_alloc_get_xlat_entry(old_name)) { ADD_INTERNED_STRING(op_array->function_name); - zend_shared_alloc_register_xlat_entry(old_name, op_array->function_name); + if (!zend_shared_alloc_get_xlat_entry(op_array->function_name)) { + zend_shared_alloc_register_xlat_entry(old_name, op_array->function_name); + } } } -- 2.50.0