From: Nikita Popov Date: Fri, 5 Jul 2019 08:44:48 +0000 (+0200) Subject: Fix wrong size calculation related to function name X-Git-Tag: php-7.4.0alpha3~37 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ea43624972b51c367614c62257bda09a90f1d76f;p=php 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. --- 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); + } } }