Repository navigation
fix: append wide arrays without call spreads - #10539
Conversation
Fixes #10445 Supersedes #10446 Co-Authored-By: gensokyo-dev <[email protected]>
Refs #10445 Co-Authored-By: gensokyo-dev <[email protected]>
Refs #10342 Co-Authored-By: gensokyo-dev <[email protected]>
Supersedes #10342 Co-Authored-By: gensokyo-dev <[email protected]>
`target.push(...items)` passes every item as a call argument and overflows the stack once a target-sized array grows past the engine's argument limit. This class was fixed one site at a time in #10304, #10343, #10362 and #8632. Add one shared appendAll helper in src/domain and use it at the remaining sites whose arrays grow with the input: XML member counting, app-task row suggestions, native call routes and unresolved calls, call-path caveats, environment-manifest merges, reference-source import entries, dyld trace edges and JS symbolic flow values. The web bundle merge from the previous commit now uses the shared helper too. Bounded spreads (fixed literals, page-sized reads) are left as they are. Refs #10445 Refs #10342 Co-Authored-By: gensokyo-dev <[email protected]>
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; the previous wide-branch failure is fixed and no new blocking issue was found. SummaryReplaces wide array call spreads with loops and a shared
Reviews (3) · Last reviewed commit: "fix(javascript): join wide symbolic bran..." · Reviewed by Greptile |
The block branch of the symbolic return flow already appended without a call spread, but the adjacent if branch and both continuation-condition joins still spread, so a generated wrapper with a wide tree of unknown conditions could still overflow the argument limit. Refs #10445 Co-Authored-By: gensokyo-dev <[email protected]>
Summary
push(...items)and other call spreads throwRangeErroronce an array exceeds the engine's argument limit, even when the items are within REA's own byte and count admission. This lands two contributor fixes for real crashes of this kind and converts the remaining unbounded sites to one shared helper. Merge with rebase to keep per-commit authorship.Fixes #10445
Refs #10342
script_key(#10445)src/domain/appendAll.tsappends with a loop, and 11 other sites whose input size follows the target (reference imports, native call routes, environment manifest rules, dylib resolution, call paths, app task draft rows and member counts, JS symbolic bindings, web bundle results) use it. After review, theif-branch and continuation-condition joins in the symbolic return flow do tooContribution scope: ordinary fixes within existing boundaries; maintainer scope decision not applicable.
Not included: a lint rule against call spreads on unbounded arrays. There are about 130
push(...sites insrc/, most bounded by construction, so whether to enforce this with a rule is left as a maintainer decision.Evidence and regression coverage
appendAll.test.tsappends more items than the engine's argument limit allows in one call.webBundleResultCapacity.test.tsandbunStandaloneCli.test.ts(from the contributor PRs) cover the crashing inputs.Validation performed
npm run test:focused --on the three changed test files, after rebasing onto current main: 9 passed. When the branch was prepared, the wider affected set passed: 622 tests.npm run check:fast(pre-push): passed.oxfmt --checkon the changed files: clean.Compatibility, safety, and release
Author readiness
Human owner: N0zoM1z0 (PR author, exempt from the declaration per CONTRIBUTING.md).
Supersedes #10446 and #10342.