diff options
author | Son Ho | 2022-11-06 13:17:09 +0100 |
---|---|---|
committer | Son HO | 2022-11-07 10:36:13 +0100 |
commit | 55a4a7c8ef7bf9b393b593c8d4591aad7895cf06 (patch) | |
tree | c2737530e63a80632dacb18bc59de42b3232b738 /compiler/Interpreter.ml | |
parent | ef4ac7cb389e2b135b1a81f448aa90ee7d7d8430 (diff) |
Replace all the occurrences of `failwith ...` with `raise (Failure ...)`
Diffstat (limited to '')
-rw-r--r-- | compiler/Interpreter.ml | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/Interpreter.ml b/compiler/Interpreter.ml index f92473f7..cf40c5b8 100644 --- a/compiler/Interpreter.ml +++ b/compiler/Interpreter.ml @@ -261,7 +261,8 @@ let evaluate_function_symbolic (config : C.partial_config) (synthesize : bool) * the executions can lead to a panic *) if synthesize then Some SA.Panic else None | _ -> - failwith ("evaluate_function_symbolic failed on: " ^ name_to_string ()) + raise + (Failure ("evaluate_function_symbolic failed on: " ^ name_to_string ())) in (* Evaluate the function *) @@ -310,9 +311,10 @@ module Test = struct (* Ok: drop the local variables and finish *) ctx_pop_frame config (fun _ _ -> None) ctx | _ -> - failwith - ("Unit test failed (concrete execution) on: " - ^ Print.fun_name_to_string fdef.A.name) + raise + (Failure + ("Unit test failed (concrete execution) on: " + ^ Print.fun_name_to_string fdef.A.name)) in (* Evaluate the function *) |