Skip to content

Fix: Exponents50to69::tryEmit accepts null runtime $expFold (#36387) - #37651

Merged
PurHur merged 1 commit into
masterfrom
agent/fix-36387-exponents50to69-null-expfold
Sep 9, 2026
Merged

Fix: Exponents50to69::tryEmit accepts null runtime $expFold (#36387)#37651
PurHur merged 1 commit into
masterfrom
agent/fix-36387-exponents50to69-null-expfold

Conversation

@PurHur

@PurHur PurHur commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • JitPowIntegerEmitExponents50to69::tryEmit() was extracted with string $expFold — Low/Mid/High all use ?string $expFold with a null-guard. Without this, pow($n, $runtime_var) under AOT crashes with a TypeError when the hub dispatches to this TU.
  • One-line fix: ?string + early return false on null.

Closes #36387 (part of — bug introduced by #37649)

php-src: Zend/zend_operators.c pow_function; ext/standard/math.c PHP_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

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>
@PurHur
PurHur merged commit 73bc320 into master Sep 9, 2026
1 check failed
@PurHur
PurHur deleted the agent/fix-36387-exponents50to69-null-expfold branch September 9, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant