diff options
author | Son Ho | 2021-12-17 14:00:37 +0100 |
---|---|---|
committer | Son Ho | 2021-12-17 14:00:37 +0100 |
commit | 30d3db0d339a9a577fd310bf7e96d8cd0b0dede7 (patch) | |
tree | e90bea9adf78addcf1d89273b8d1859c110cc300 | |
parent | 90f86e66fe8a91a0d094ad904875f6e8ad7fd5ae (diff) |
Implement the ASharedLoan case of reborrow_shared
-rw-r--r-- | src/Interpreter.ml | 8 |
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 |