Perf: printf/sprintf %s of overflowable native-long matches Zend (#36386) - #37068
Merged
Merged
Conversation
) extractAsCString fell through TYPE_VALUE to a constant empty C string after lazy ±/×/`/` materialize; type-switch boxed args and overflow flag+f64 slots instead (peer of #37064 echo). Free only the selected arm buffer via phi. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Sep 6, 2026
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
/overflow materialize (Perf: lazy f64 overflow slot for native-long ±/× (#36386) #37051),printf/sprintf%sprinted empty whileecho/print_r/%gmatched Zend (peer of Perf: echo overflowable native-long via local stack box (#36386) #37064).JitSprintf::extractAsCStringfell throughTYPE_VALUEto a constant empty C string; also need overflow-flag+f64-slot stringify for inlinePHP_INT_MAX + 1.__value__*for%s(double→gcvt, long→%lld, bool/string/fallback), plus a dedicated overflowable-native-long path. Free only the selected arm’s buffer via phi (per-arm$toFree[]during IR gen freed unallocated sibling arms → intermittent SIGSEGV).php-src:
ext/standard/formatted_print.cphp_formatted_print/convert_to_string.Test plan
./script/phpunit.sh --filter 'SprintfOverflowableNativeLongAotTest|EchoOverflowableNativeLongAotTest|NativeLongOverflowHeapLazyAotTest'→ 9/9./script/aot-smoke.sh→ 9/9 + size gate OKmake north-star5-verify-fast→ OK (spine 8349/8349)script/differential-sweep.sh --aot --repeat 3(printf/sprintf overflow cases) → 3/3PHP_COMPILER_CACHE=0: assign overflow, assign mul-add, inline overflow, inline mul-add — all MATCH ZendCloses nothing (epic #36386 stays open). Part of #36386.
Made with Cursor