Skip to content

Perf: is_numeric of overflow floats matches Zend without SIGSEGV (#36386) - #37085

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-36386-is-numeric-overflow-aot
Sep 6, 2026
Merged

Perf: is_numeric of overflow floats matches Zend without SIGSEGV (#36386)#37085
PurHur merged 1 commit into
masterfrom
agent/issue-36386-is-numeric-overflow-aot

Conversation

@PurHur

@PurHur PurHur commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • is_numeric() of overflow-promoted floats (e.g. PHP_INT_MAX + 1 via named assign / foreach) SIGSEGV under AOT while floatval / strval / is_float / gettype matched Zend — leftover of Perf: lazy f64 overflow slot for native-long ±/× (#36386) #37051 lazy ±/× materialize.
  • Root cause: TYPE_VALUE arm eagerly called __value__readString / __value__readLong before the type select; double boxes fed garbage into strtod. Unnamed overflow SSA temps (is_numeric($i + 1)) also need a numeric short-circuit (both ±/× arms are IS_LONG / IS_DOUBLE).
  • php-src: Zend/zend_builtin_functions.c zif_is_numeric / ZEND_IS_NUMERIC.

Part of #36386

Test plan

  • ./script/phpunit.sh --filter IsNumericOverflowableAotTest → OK (4 tests, 20 assertions)
  • ./script/aot-smoke.sh → 9 passed, 0 failed (size gate OK)
  • make north-star5-verify-fast → OK (spine 8355/8355)
  • Not run: script/differential-sweep.sh --aot (no call/CFG shape change beyond is_numeric type-branch normalize)

Made with Cursor

)

TYPE_VALUE arm branched before readString/readLong; overflowable ±/× SSA temps short-circuit to true.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant