diff options
author | Son Ho | 2022-01-13 20:53:20 +0100 |
---|---|---|
committer | Son Ho | 2022-01-13 20:53:20 +0100 |
commit | 8dfe03ed7c23ecec2844287c341be9d745c2ebb2 (patch) | |
tree | 074cddd0a5bc2153b89706a016cd05af2e64348a /src/ValuesUtils.ml | |
parent | d673cdc47a0b948871ac939075411be0929399c9 (diff) |
Make more updates to assignment and update ctx_pop_frame
Diffstat (limited to '')
-rw-r--r-- | src/ValuesUtils.ml | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ValuesUtils.ml b/src/ValuesUtils.ml index 16c94800..f90a98ef 100644 --- a/src/ValuesUtils.ml +++ b/src/ValuesUtils.ml @@ -60,3 +60,21 @@ let loans_in_value (v : typed_value) : bool = obj#visit_typed_value () v; false with Found -> true + +(** Check if a value contains outer loans (i.e., loans which are not in borrwed + values. *) +let outer_loans_in_value (v : typed_value) : bool = + let obj = + object + inherit [_] iter_typed_value + + method! visit_loan_content _env _ = raise Found + + method! visit_borrow_content _ _ = () + end + in + (* We use exceptions *) + try + obj#visit_typed_value () v; + false + with Found -> true |