Repository navigation
fix(hy-check): enforce T24 index projection, closure slot-loan rebind & nested borrow_bindings escape (HYB-E3104) (#1445) - #1720
Open
ubelai wants to merge 1 commit into
Conversation
Contributor
|
Shepherd (Phase A — propose only): this PR's changed-file set overlaps >=0.6 Jaccard with #1790, which carries the larger take. Proposing close as superseded. This is a proposal, not a close — nothing auto-closes while this comment is fresh. If this PR has unique content (a different rule, extra tests, a different fix), say so or push, and the label comes off. Cluster signal is a file-set heuristic; the verdict stays human. |
This was referenced Oct 31, 2026
ubelai
force-pushed
the
fix/slot-loan-t24-rebind-and-escape-e3104
branch
2 times, most recently
from
November 3, 2026 02:56
89dc4f0 to
4bc0c6c
Compare
ubelai
force-pushed
the
fix/slot-loan-t24-rebind-and-escape-e3104
branch
from
November 9, 2026 22:59
4bc0c6c to
1e36ed8
Compare
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.
Fixes #1445
Summary
Closes three
HYB-E3104(T24/O8/O2 LOAN-ESCAPE) soundness and buildable-Go gaps on map-slot loans (n := &m[k]):compiler/crates/hy-check/src/addr_loan.rs(walk_addr_of_loan_projections, line 337):Expr::Field { .. } | Expr::Index { .. }(matching the existing docstring ataddr_loan.rs:153-156) so taking the address of an array or slice index projection rooted at a map-slot loan (&n.arr[0],&n.fixed[0]) is rejected withHYB-E3104(T24).compiler/crates/hy-check/src/emit_guard.rs(check_stmt_emit_guard_inner, line 156):self.check_slot_loan_rebind(st, stmt)beforeself.mark_slot_loans_assign(st, targets, *op, values)whendeep == trueso re-binding a closure-local map-slot loan to a general pointer (s = &other) ornil(s = nil) is rejected withHYB-E3104(T24), matching top-levelcheck_fn_body.compiler/crates/hy-check/src/closures.rs(check_one_closure, line 217):borrow_bindings: st.borrow_bindings.clone()intocstso returning a captured borrow or map-slot loan from a nested closure is rejected withHYB-E3104(O2 LOAN-ESCAPE).compiler/crates/hy-check/src/closures.rs):reject_addr_of_index_projection_on_slot_loan_t24reject_closure_slot_loan_rebind_to_general_pointer_or_nil_t24175/175hy-checkunit tests +65/65integration test suites (240/240total) pass with0failures.Payout wallet (EVM / USDC):
0x1d74c4F8655ca2b7BCA7D41C60320ebB23990eA3