Skip to content

Zend: Clear synthesized FREE metadata - #386

Closed
iliaal wants to merge 1 commit into
masterfrom
fix/aph-zend-dce-free-extended-value-dhtt-84-work
Closed

iliaal wants to merge 1 commit into
masterfrom
fix/aph-zend-dce-free-extended-value-dhtt-84-work

Conversation

@iliaal

@iliaal iliaal commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Clear stale opcode metadata only when DCE synthesizes ZEND_FREE, while preserving existing FREE loop and exception metadata.

DCE rewrites a dead instruction whose operand still needs freeing into a
FREE, but kept the instruction's extended_value. After (float) and (array)
casts and empty() it has bit 0 set, which ZEND_HANDLE_EXCEPTION reads as
ZEND_FREE_ON_RETURN: when a destructor run by that FREE throws, the throw
point moves by the FREE's op2, which is (uint32_t)-1, and
cleanup_live_vars() frees the operand a second time.
@iliaal
iliaal changed the base branch from PHP-8.4 to master November 27, 2026 12:06
@iliaal
iliaal force-pushed the fix/aph-zend-dce-free-extended-value-dhtt-84-work branch from c55e914 to 34b7e70 Compare November 27, 2026 12:06
@iliaal

iliaal commented Nov 27, 2026

Copy link
Copy Markdown
Owner Author

Submitted upstream as php#25836.

@iliaal iliaal closed this Nov 27, 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.

1 participant