summaryrefslogtreecommitdiff
path: root/compiler/InterpreterLoopsMatchCtxs.ml
diff options
context:
space:
mode:
authorEscherichia2024-03-27 10:22:06 +0100
committerEscherichia2024-03-28 15:35:20 +0100
commit0f0082c81db8852dff23cd4691af19c434c8be78 (patch)
treeeaf4c6e6faaceaeaf86e47b7b61249f86c08f65d /compiler/InterpreterLoopsMatchCtxs.ml
parentc47e349dedaaf0e3161869740ea769332ffd24ca (diff)
Added sanity_check and sanity_check_opt_meta helpers and changed sanity checks related cassert to these helpers to have a proper error message
Diffstat (limited to '')
-rw-r--r--compiler/InterpreterLoopsMatchCtxs.ml12
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/InterpreterLoopsMatchCtxs.ml b/compiler/InterpreterLoopsMatchCtxs.ml
index 2e700c50..435174a7 100644
--- a/compiler/InterpreterLoopsMatchCtxs.ml
+++ b/compiler/InterpreterLoopsMatchCtxs.ml
@@ -43,8 +43,8 @@ let compute_abs_borrows_loans_maps (meta : Meta.meta) (no_duplicates : bool)
match Id0.Map.find_opt id0 !map with
| None -> ()
| Some set ->
- cassert (
- (not check_not_already_registered) || not (Id1.Set.mem id1 set)) meta "TODO: error message");
+ sanity_check (
+ (not check_not_already_registered) || not (Id1.Set.mem id1 set)) meta);
(* Update the mapping *)
map :=
Id0.Map.update id0
@@ -53,10 +53,10 @@ let compute_abs_borrows_loans_maps (meta : Meta.meta) (no_duplicates : bool)
| None -> Some (Id1.Set.singleton id1)
| Some ids ->
(* Sanity check *)
- cassert (not check_singleton_sets) meta "TODO: error message";
- cassert (
+ sanity_check (not check_singleton_sets) meta;
+ sanity_check (
(not check_not_already_registered)
- || not (Id1.Set.mem id1 ids)) meta "TODO: error message";
+ || not (Id1.Set.mem id1 ids)) meta;
(* Update *)
Some (Id1.Set.add id1 ids))
!map
@@ -691,7 +691,7 @@ module MakeJoinMatcher (S : MatchJoinState) : PrimMatcher = struct
let id1 = sv1.sv_id in
if id0 = id1 then (
(* Sanity check *)
- cassert (sv0 = sv1) meta "TODO: error message";
+ sanity_check (sv0 = sv1) meta;
(* Return *)
sv0)
else (