summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSon Ho2021-12-17 14:00:37 +0100
committerSon Ho2021-12-17 14:00:37 +0100
commit30d3db0d339a9a577fd310bf7e96d8cd0b0dede7 (patch)
treee90bea9adf78addcf1d89273b8d1859c110cc300
parent90f86e66fe8a91a0d094ad904875f6e8ad7fd5ae (diff)
Implement the ASharedLoan case of reborrow_shared
-rw-r--r--src/Interpreter.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Interpreter.ml b/src/Interpreter.ml
index b58afb4c..caac0de7 100644
--- a/src/Interpreter.ml
+++ b/src/Interpreter.ml
@@ -1082,7 +1082,13 @@ let reborrow_shared (original_bid : V.BorrowId.id) (new_bid : V.BorrowId.id)
V.SharedLoan (bids', sv))
else super#visit_SharedLoan env bids sv
- method! visit_Abs _ _ = raise Unimplemented
+ method! visit_ASharedLoan env bids v av =
+ (* This case is similar to the [SharedLoan] case *)
+ if V.BorrowId.Set.mem original_bid bids then (
+ set_ref ();
+ let bids' = V.BorrowId.Set.add new_bid bids in
+ V.ASharedLoan (bids', v, av))
+ else super#visit_ASharedLoan env bids v av
end
in