From 51c43721beb1f4af1e903360c0fbc5c1790f1ab5 Mon Sep 17 00:00:00 2001 From: Son Ho Date: Fri, 24 May 2024 15:56:34 +0200 Subject: Start adding markers --- compiler/InterpreterPaths.ml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'compiler/InterpreterPaths.ml') diff --git a/compiler/InterpreterPaths.ml b/compiler/InterpreterPaths.ml index faba1088..a74017d1 100644 --- a/compiler/InterpreterPaths.ml +++ b/compiler/InterpreterPaths.ml @@ -187,7 +187,7 @@ let rec access_projection (span : Meta.span) (access : projection_access) Ok (ctx, { res with updated = v })) | ( _, Abstract - ( AMutLoan (_, _) + ( AMutLoan (_, _, _) | AEndedMutLoan { given_back = _; child = _; given_back_span = _ } | AEndedSharedLoan (_, _) @@ -197,7 +197,9 @@ let rec access_projection (span : Meta.span) (access : projection_access) | AIgnoredSharedLoan _ ) ) -> craise __FILE__ __LINE__ span "Expected a shared (abstraction) loan" - | _, Abstract (ASharedLoan (bids, sv, _av)) -> ( + | _, Abstract (ASharedLoan (pm, bids, sv, _av)) -> ( + (* Sanity check: markers can only appear when we're doing a join *) + sanity_check __FILE__ __LINE__ (pm = PNone) span; (* Explore the shared value *) match access_projection span access ctx update p' sv with | Error err -> Error err @@ -205,14 +207,14 @@ let rec access_projection (span : Meta.span) (access : projection_access) (* Relookup the child avalue *) let av = match lookup_loan span ek bid ctx with - | _, Abstract (ASharedLoan (_, _, av)) -> av + | _, Abstract (ASharedLoan (_, _, _, av)) -> av | _ -> craise __FILE__ __LINE__ span "Unexpected" in (* Update the shared loan with the new value returned by {!access_projection} *) let ctx = update_aloan span ek bid - (ASharedLoan (bids, res.updated, av)) + (ASharedLoan (pm, bids, res.updated, av)) ctx in (* Return - note that we don't need to update the borrow itself *) -- cgit v1.2.3 From 18623d7ee894a8e21bca9ef58fb4087cb4be558b Mon Sep 17 00:00:00 2001 From: Son Ho Date: Mon, 3 Jun 2024 12:08:36 +0200 Subject: Make minor modifications --- compiler/InterpreterPaths.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/InterpreterPaths.ml') diff --git a/compiler/InterpreterPaths.ml b/compiler/InterpreterPaths.ml index a74017d1..b2de3b22 100644 --- a/compiler/InterpreterPaths.ml +++ b/compiler/InterpreterPaths.ml @@ -198,7 +198,7 @@ let rec access_projection (span : Meta.span) (access : projection_access) craise __FILE__ __LINE__ span "Expected a shared (abstraction) loan" | _, Abstract (ASharedLoan (pm, bids, sv, _av)) -> ( - (* Sanity check: markers can only appear when we're doing a join *) + (* Sanity check: projection markers can only appear when we're doing a join *) sanity_check __FILE__ __LINE__ (pm = PNone) span; (* Explore the shared value *) match access_projection span access ctx update p' sv with -- cgit v1.2.3