Skip to content

ext/opcache: Do not drop QM_ASSIGN of IS_VAR before ZEND_RETURN - #25814

Closed
iliaal wants to merge 1 commit into
php:PHP-8.6from
iliaal:fix/gh-25756-return-assign-ref-opcache
Closed

iliaal wants to merge 1 commit into
php:PHP-8.6from
iliaal:fix/gh-25756-return-assign-ref-opcache

Conversation

@iliaal

@iliaal iliaal commented Nov 26, 2026

Copy link
Copy Markdown
Member

The block optimizer can fold a dereferencing QM_ASSIGN into ZEND_RETURN when returning a by-reference assignment or list destructuring. Preserve the QM_ASSIGN when its source is IS_VAR because ZEND_RETURN only accepts CONST, TMP, and CV operands.

Fixes GH-25756

Keep the dereferencing QM_ASSIGN when its source is IS_VAR. ZEND_RETURN
only accepts CONST, TMP, and CV, so folding the assignment into the
return can produce an invalid opcode for by-reference assignments or
list destructuring.

Fixes phpGH-25756
@iliaal iliaal closed this in 16c4662 Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants