Fix GH-22549: GMP compound pow/shift assign asserts on negative operand#145
Closed
iliaal wants to merge 1 commit into
Closed
Fix GH-22549: GMP compound pow/shift assign asserts on negative operand#145iliaal wants to merge 1 commit into
iliaal wants to merge 1 commit into
Conversation
…erand shift_operator_helper() wrote ZVAL_UNDEF(return_value) on the out-of-range exponent/shift path, but for a compound assignment return_value aliases op1, so pow_function's fallback then reached the scalar conversion with op1 set to IS_UNDEF and hit ZEND_UNREACHABLE(). Drop the stray undef; the helper's other error paths already return FAILURE without touching return_value, leaving the operand intact for the thrown ValueError to propagate. Fixes phpGH-22549
Owner
Author
|
Promoted upstream: php#22582 |
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.
Removes a stray
ZVAL_UNDEF(return_value)in GMP'sshift_operator_helper()that clobberedop1on a compound$x **= gmp_init(-5)(whereresultaliasesop1), makingpow_function's fall-through assert on anIS_UNDEFoperand. Affects POW/SL/SR; the other failure paths already return without touchingreturn_value.Fixes php#22549