summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSon Ho2022-01-26 23:48:37 +0100
committerSon Ho2022-01-26 23:48:37 +0100
commit616b46cedb92537f0df711da3f2615a23bbaaa5c (patch)
tree4688e277dc56f6802606e5a2d2c5cba456071662
parent8e7071145b9f0deef99bb794af3629435a1b5fce (diff)
Fix a small issue in end_abstraction_loans: the loan_content case was
not implemented
Diffstat (limited to '')
-rw-r--r--src/InterpreterBorrows.ml13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/InterpreterBorrows.ml b/src/InterpreterBorrows.ml
index 20314120..487e308a 100644
--- a/src/InterpreterBorrows.ml
+++ b/src/InterpreterBorrows.ml
@@ -1063,6 +1063,15 @@ and end_abstraction_loans (config : C.config) (chain : borrow_or_abs_ids)
| V.AIgnoredSharedLoan _ ->
super#visit_aloan_content env lc
+ method! visit_loan_content env lc =
+ match lc with
+ | V.MutLoan _ ->
+ (* The mut loan linked to the mutable borrow present in a shared
+ * value in an abstraction should be in an AProjBorrows *)
+ failwith "Unreachable"
+ | V.SharedLoan (bids, _) -> raise (FoundBorrowIds (Borrows bids))
+ (** We may need to visit loan contents because of shared values *)
+
method! visit_aproj env sproj =
(match sproj with
| V.AProjBorrows (_, _)
@@ -1149,6 +1158,10 @@ and end_abstraction_borrows (config : C.config) (chain : borrow_or_abs_ids)
| V.AEndedProjLoans _ | V.AEndedProjBorrows _ | V.AIgnoredProjBorrows ->
());
super#visit_aproj env sproj
+
+ method! visit_borrow_content env bc =
+ (* TODO: this happens because of shared values *)
+ raise Errors.Unimplemented
end
in
(* Lookup the abstraction *)