[php-src] master: opcache: Use ZEND_HANDLE_NUMERIC in JIT symtable helpers (#25715)

From: Date: Tue, 24 Nov 2026 21:32:13 +0000
Subject: [php-src] master: opcache: Use ZEND_HANDLE_NUMERIC in JIT symtable helpers (#25715)
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-144138@lists.php.net to get a copy of this message
Author: Alexander Danilov (adapik) Committer: GitHub (web-flow) Pusher: Girgias Date: 2026-11-24T21:32:09Z Commit: https://github.com/php/php-src/commit/336954a2f54b48e82499de6807a772d8e07cab7c Raw diff: https://github.com/php/php-src/commit/336954a2f54b48e82499de6807a772d8e07cab7c.diff opcache: Use ZEND_HANDLE_NUMERIC in JIT symtable helpers (#25715) Changed paths: M ext/opcache/jit/zend_jit_helpers.c Diff: diff --git a/ext/opcache/jit/zend_jit_helpers.c b/ext/opcache/jit/zend_jit_helpers.c index 2fa48320c500..d9b91d299f59 100644 --- a/ext/opcache/jit/zend_jit_helpers.c +++ b/ext/opcache/jit/zend_jit_helpers.c @@ -309,24 +309,10 @@ static zend_execute_data* ZEND_FASTCALL zend_jit_int_extend_stack_helper(uint32_ static zval* ZEND_FASTCALL zend_jit_symtable_find(HashTable *ht, zend_string *str) { zend_ulong idx; - register const char *tmp = ZSTR_VAL(str); - do { - if (*tmp > '9') { - break; - } else if (*tmp < '0') { - if (*tmp != '-') { - break; - } - tmp++; - if (*tmp > '9' || *tmp < '0') { - break; - } - } - if (_zend_handle_numeric_str_ex(ZSTR_VAL(str), ZSTR_LEN(str), &idx)) { - return zend_hash_index_find(ht, idx); - } - } while (0); + if (ZEND_HANDLE_NUMERIC(str, idx)) { + return zend_hash_index_find(ht, idx); + } return zend_hash_find(ht, str); } @@ -367,29 +353,15 @@ static zval* ZEND_FASTCALL zend_jit_hash_lookup_rw(HashTable *ht, zend_string *s static zval* ZEND_FASTCALL zend_jit_symtable_lookup_rw(HashTable *ht, zend_string *str) { zend_ulong idx; - register const char *tmp = ZSTR_VAL(str); zval *retval; - do { - if (*tmp > '9') { - break; - } else if (*tmp < '0') { - if (*tmp != '-') { - break; - } - tmp++; - if (*tmp > '9' || *tmp < '0') { - break; - } + if (ZEND_HANDLE_NUMERIC(str, idx)) { + retval = zend_hash_index_find(ht, idx); + if (!retval) { + retval = zend_undefined_offset_write(ht, idx); } - if (_zend_handle_numeric_str_ex(ZSTR_VAL(str), ZSTR_LEN(str), &idx)) { - retval = zend_hash_index_find(ht, idx); - if (!retval) { - retval = zend_undefined_offset_write(ht, idx); - } - return retval; - } - } while (0); + return retval; + } retval = zend_hash_find(ht, str); if (!retval) { @@ -402,24 +374,10 @@ static zval* ZEND_FASTCALL zend_jit_symtable_lookup_rw(HashTable *ht, zend_strin static zval* ZEND_FASTCALL zend_jit_symtable_lookup_w(HashTable *ht, zend_string *str) { zend_ulong idx; - register const char *tmp = ZSTR_VAL(str); - do { - if (*tmp > '9') { - break; - } else if (*tmp < '0') { - if (*tmp != '-') { - break; - } - tmp++; - if (*tmp > '9' || *tmp < '0') { - break; - } - } - if (_zend_handle_numeric_str_ex(ZSTR_VAL(str), ZSTR_LEN(str), &idx)) { - return zend_hash_index_lookup(ht, idx); - } - } while (0); + if (ZEND_HANDLE_NUMERIC(str, idx)) { + return zend_hash_index_lookup(ht, idx); + } return zend_hash_lookup(ht, str); }

« previous php.cvs (#144138) next »