Repository navigation
Conversation
arnaud-lb
approved these changes
Nov 27, 2026
arnaud-lb
left a comment
Member
There was a problem hiding this comment.
Looks good to me!
Did you want to target 8.4 ?
iliaal
force-pushed
the
fix/aph-zend-dce-free-extended-value-dhtt-84-work
branch
from
November 27, 2026 15:16
34b7e70 to
7b44256
Compare
Member
Author
|
Yes, retargeted to 8.4. |
arnaud-lb
approved these changes
Nov 27, 2026
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
force-pushed
the
fix/aph-zend-dce-free-extended-value-dhtt-84-work
branch
from
November 27, 2026 18:10
7b44256 to
97ee5bd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a destructor run by a FREE that DCE synthesized throws,
cleanup_live_vars()frees the operand a second time. DCE turns a dead instruction whose operand still needs freeing into a FREE but keeps the oldextended_value. After a(float)or(array)cast orempty(), that value has bit 0 set, which ZEND_HANDLE_EXCEPTION reads as ZEND_FREE_ON_RETURN. The test pinsopcache.jit=disablebecause function JIT has a separate destructor-timing bug in the same code, caused byresult_may_be_separated().