diff options
author | Son Ho | 2022-01-26 23:48:37 +0100 |
---|---|---|
committer | Son Ho | 2022-01-26 23:48:37 +0100 |
commit | 616b46cedb92537f0df711da3f2615a23bbaaa5c (patch) | |
tree | 4688e277dc56f6802606e5a2d2c5cba456071662 | |
parent | 8e7071145b9f0deef99bb794af3629435a1b5fce (diff) |
Fix a small issue in end_abstraction_loans: the loan_content case was
not implemented
Diffstat (limited to '')
-rw-r--r-- | src/InterpreterBorrows.ml | 13 |
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 *) |