fix(codegen): root the URL setters and forEach operands; url_main.rs is clean - #7464
Conversation
…is clean Closes the last two shapes in this file. The nine URL setters share one match arm, so a single fix covers pathname/search/hash/protocol/hostname/port/username/password/href: the receiver was unboxed to a raw heap pointer and then `value` lowered -- arbitrary user code -- before the runtime call used it. forEach had TWO windows, not one: the receiver crossed the `callback` lowering, and both it and the callback crossed `this_arg`'s. All operands are rooted together, `this_arg` included when present. Arm-aware audit of the whole file now reports: 9 guards, each with exactly one top-level release 0 remaining raw-pointer-across-lowering sites The earlier scan's "9 remaining" included three false positives -- it crossed match-arm boundaries and paired a receiver with the NEXT arm's lower_expr. Entries/Keys/Values use their receiver immediately. URL-family gap tests byte-identical to node; a setters+forEach repro with allocating arguments matches node and is clean under PERRY_GC_HEAP_LIMIT=8 PERRY_GC_FORCE_EVACUATE=1.
|
Warning Review limit reached
Next review available in: 8 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughURL setters and ChangesURL operand rooting
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes the last two shapes in
url_main.rs.Nine setters in one arm
UrlSetPathname | Search | Hash | Protocol | Hostname | Port | Username | Password | Hrefshare a single match arm, so one fix covers all nine. The receiver was unboxed to a raw heap pointer and thenvaluelowered — arbitrary user code — before the runtime call used it.forEach had two windows, not one
The receiver crossed the
callbacklowering, and both it and the callback crossedthis_arg's. All operands are rooted together,this_argincluded when present.The file is now clean, by an arm-aware audit
Both properties are checked by script rather than by reading, because on this file "it compiles" has now twice failed to catch a real defect — an unbound guard that emitted no truncate (#7462), and a release placed inside one branch of an if/else (#7463).
Correcting the earlier count
My previous scan reported "9 remaining". Three were false positives: it crossed match-arm boundaries and paired a receiver with the next arm's
lower_expr.Entries,KeysandValuesuse their receiver immediately with nothing in between. The scan is now arm-aware.Verification
forEachrepro with allocating arguments matches node exactly (/p5 true 4) and is unchanged underPERRY_GC_HEAP_LIMIT=8 PERRY_GC_FORCE_EVACUATE=1cargo fmt --checkcleanSummary by CodeRabbit
URLSearchParams.forEachbehavior, including handling of callbacks and optional context values.