Repository navigation
Conversation
…ches Since phpGH-20628, FETCH_DIM_R and FETCH_OBJ_R expect a VAR container to be unwrapped already. Pass 4 turned FETCH_DIM_FUNC_ARG and FETCH_OBJ_FUNC_ARG into their _R forms once the argument was known to be by-value, without checking where the VAR came from, so a reference returned by a by-reference call or produced by an assignment by reference reached the _R handler. Retype a defining DO_*CALL result and the fetch operand to TMP, so the callee unwraps its return value as it does when the callee is known at compile time. Keep the FUNC_ARG fetch for any other producer that is not an already converted read fetch. Fixes phpGH-25449
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.
When
g()returns by reference and the callee off(g()['k'])is not known at compile time, OPcache passes null tof()and debug builds assert in FETCH_DIM_R. Since GH-20628, FETCH_DIM_R and FETCH_OBJ_R expect a VAR container to be unwrapped already, but pass 4 converts the FUNC_ARG fetch to its _R form while the container is still the VAR result of the by-ref call; an assignment by reference such asf(($y = &$x)['k'])hits the same assertion. Retype the call result to TMP, as the compiler emits for a known callee, and keep the FUNC_ARG fetch for any other producer except an already converted read fetch.Fixes #25449