Fix: Exponents50to69::tryEmit accepts null runtime $expFold (#36387) - #37651
Merged
Conversation
Mirror Low/Mid/High — null compile-time fold (runtime exponent) must fall through to MathFpow, not TypeError on the string param. Without this, `pow($n, $runtime_var)` crashes under AOT when the hub dispatches to this TU. Low (1–29), Mid (30–49) and High (70+) already have the guard; Exponents50to69 was extracted without it in #37649. Co-authored-by: Cursor <cursoragent@cursor.com>
7 tasks
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
JitPowIntegerEmitExponents50to69::tryEmit()was extracted withstring $expFold— Low/Mid/High all use?string $expFoldwith a null-guard. Without this,pow($n, $runtime_var)under AOT crashes with a TypeError when the hub dispatches to this TU.?string+ earlyreturn falseon null.Closes #36387 (part of — bug introduced by #37649)
php-src:
Zend/zend_operators.cpow_function;ext/standard/math.cPHP_FUNCTION(pow).Test plan
./script/phpunit.sh --filter 'NoThrowPowFiftiethMulAotTest|NoThrowPowSixtyninthMulAotTest|NoThrowPowFortyninthMulAotTest|NoThrowPowSeventiethMulAotTest'→ OK (16 tests, 92 assertions)php script/check-size-budgets.php→ OK (budget updated +8 lines for null guard)Not covered: full aot-smoke, north-star5 (no behavior change to passing paths).
Made with Cursor