Language: unpack() enum offset — inline pack call-arg slot wiring (#8866)#18661
Merged
Merged
Conversation
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.
Summary
unpack('i', pack('i', 1), E::A)whenpack()is an inline middle argument: the nestedpackEXEC_RETURN now feeds argument Php stdlib specs implementation #2 ($string) and the hoisted enum case feeds argument Stdlib: ceil, floor, intval and expanded PHPT specs #3 ($offset).nestedFuncCallFeedsDeadInlineCallArg()guards so hoisted enum prelude logic does not steal the middle nested-FuncCall slot.compileUnpackInlinePackEnumOffsetCallArgSends()for the literal + inline pack + enum offset pattern.Closes #8866
Root cause
php-cfg hoists
pack()andE::Abeforeunpack(). The enum prelude slot mapper treated every dead inline temp after a nested FuncCall as the enum fetch, so both unpack operands receivedE::Ainstead of pack result + enum.Verification
Made with Cursor