Skip to content

Fix GH-21691: OPcache CFG optimizer eliminates QM_ASSIGN feeding JMPZ with VAR operand#27

Closed
iliaal wants to merge 1 commit intomasterfrom
fix/gh-21691-opcache-jmpz-var
Closed

Fix GH-21691: OPcache CFG optimizer eliminates QM_ASSIGN feeding JMPZ with VAR operand#27
iliaal wants to merge 1 commit intomasterfrom
fix/gh-21691-opcache-jmpz-var

Conversation

@iliaal
Copy link
Copy Markdown
Owner

@iliaal iliaal commented Apr 9, 2026

Fixes php#21691

The CFG optimizer (pass 5) removed a QM_ASSIGN that converted IS_VAR to IS_TMP_VAR before JMPZ. Since JMPZ has no handler for IS_VAR operands, this produced "Invalid opcode 43/4/0." The pattern occurs when ASSIGN_REF (which produces IS_VAR) feeds into a conditional via QM_ASSIGN.

Skips the QM_ASSIGN elimination when the source operand is IS_VAR.

Note: the reporter's analysis pointed at DO_UCALL and zend_get_call_op, but the actual crash is in block_pass.c where the CFG optimizer strips the type-converting QM_ASSIGN.

…MPZ with VAR operand

The CFG optimizer (pass 5) removed a QM_ASSIGN that converted IS_VAR
to IS_TMP_VAR before JMPZ. JMPZ has no handler for IS_VAR operands,
producing "Invalid opcode 43/4/0." This occurred when ASSIGN_REF
(which produces IS_VAR) fed into a conditional via QM_ASSIGN.

Skip the QM_ASSIGN elimination when the source operand is IS_VAR.

Closes phpGH-21691
@iliaal iliaal force-pushed the fix/gh-21691-opcache-jmpz-var branch from db6f265 to 90f1c24 Compare April 9, 2026 19:06
@iliaal
Copy link
Copy Markdown
Owner Author

iliaal commented Apr 9, 2026

Submitted upstream as php#21696

@iliaal iliaal closed this Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PHP 8.6 OPcache: DO_UCALL breaks reference returns (segfault / invalid opcode)

1 participant