summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorAymeric Fromherz2024-05-30 13:39:18 +0200
committerAymeric Fromherz2024-05-30 13:39:37 +0200
commitad4cbc5d7d3d9f907cd12fc7bff480e61679043d (patch)
treead010c958d8301ab0c58ef8270fd75f810da9734 /compiler
parent9a860ae3ac5f0fdd4430ba39315456c0396e55e7 (diff)
Correct implementation of Join-MutBorrows: add markers when creating a new abstraction
Diffstat (limited to 'compiler')
-rw-r--r--compiler/InterpreterLoopsMatchCtxs.ml7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/InterpreterLoopsMatchCtxs.ml b/compiler/InterpreterLoopsMatchCtxs.ml
index be6f3ade..0ea832d7 100644
--- a/compiler/InterpreterLoopsMatchCtxs.ml
+++ b/compiler/InterpreterLoopsMatchCtxs.ml
@@ -666,14 +666,15 @@ module MakeJoinMatcher (S : MatchJoinState) : PrimMatcher = struct
let borrow_ty = mk_ref_ty (RFVar rid) bv_ty kind in
(* Generate the avalues for the abstraction *)
- let mk_aborrow (bid : borrow_id) (bv : typed_value) : typed_avalue =
+ let mk_aborrow (pm : proj_marker) (bid : borrow_id) (bv : typed_value) :
+ typed_avalue =
let bv_ty = bv.ty in
cassert __FILE__ __LINE__ (ty_no_regions bv_ty) span
"Nested borrows are not supported yet";
- let value = ABorrow (AMutBorrow (PNone, bid, mk_aignored span bv_ty)) in
+ let value = ABorrow (AMutBorrow (pm, bid, mk_aignored span bv_ty)) in
{ value; ty = borrow_ty }
in
- let borrows = [ mk_aborrow bid0 bv0; mk_aborrow bid1 bv1 ] in
+ let borrows = [ mk_aborrow PLeft bid0 bv0; mk_aborrow PRight bid1 bv1 ] in
let loan = AMutLoan (PNone, bid2, mk_aignored span bv_ty) in
(* Note that an aloan has a borrow type *)