[php-src] PR #24219: Fix GH-24218: Invalid opcode for count() of a literal array without SCCP
| From: | lazerg | Date: | Fri, 09 Oct 2026 15:52:01 +0000 |
| Subject: | [php-src] PR #24219: Fix GH-24218: Invalid opcode for count() of a literal array without SCCP | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-39288@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/24219
Author: lazerg
zend_compile_func_count() emits ZEND_COUNT with a CONST op1 for a literal
array. SCCP normally folds that away, but with SCCP disabled the DFA pass keeps it, and
zend_vm_set_opcode_handler_ex() picks the ZEND_COUNT_ARRAY type spec
because op1_info is MAY_BE_ARRAY. That handler only exists for CV|TMPVAR,
so the CONST slot is the null handler. The spec condition now also requires a non-CONST op1, so the
generic ZEND_COUNT handler is used in that case.
Fixes #24218