Fix GH-17428: Assertion failure ext/opcache/jit/zend_jit_ir.c:8940 #17438
+38
−3
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.
The code to update the call_level in that case skips the opline itself, as that opline is handled by the tail handler, and then wants to set the opline to the last opline of the block because the code below the switch will update the call_level for that opline.
However, the test has a block with a single opline (THROW). The block after that has ZEND_INIT_FCALL. Because
i
points to ZEND_DO_FCALL now, it erroneously updates the call_level after the switch. Although it suffices to changei
toend
(none of the opcodes here occur inzend_jit_dec_call_level
), I added a goto label and changed the loop to handle all call_level updates. This seems more robust for the future in case the list of opcodes changes.