summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSon HO2023-12-13 11:10:10 +0100
committerGitHub2023-12-13 11:10:10 +0100
commitc6247e0c103cc1dc95c2a63ae01602c4a1208dc4 (patch)
tree9b3d6aa74163ee8f26e62bf864121f9cf256a88a
parent22009543d86895b9f680d3a4abdea00302ad5f1e (diff)
parent07fc9c784e311ab082b89a63f5ca5b0c7568fc4c (diff)
Merge pull request #52 from AeneasVerif/son/matches
Make the otherwise branch in the LLBC match statements optional
Diffstat (limited to '')
-rw-r--r--compiler/InterpreterStatements.ml5
-rw-r--r--flake.lock6
2 files changed, 7 insertions, 4 deletions
diff --git a/compiler/InterpreterStatements.ml b/compiler/InterpreterStatements.ml
index 66b8492a..30b7b333 100644
--- a/compiler/InterpreterStatements.ml
+++ b/compiler/InterpreterStatements.ml
@@ -1125,7 +1125,10 @@ and eval_switch (config : config) (switch : switch) : st_cm_fun =
let dv = Option.get adt.variant_id in
(* Find the branch, evaluate and continue *)
match List.find_opt (fun (svl, _) -> List.mem dv svl) stgts with
- | None -> eval_statement config otherwise cf ctx
+ | None -> (
+ match otherwise with
+ | None -> raise (Failure "No otherwise branch")
+ | Some otherwise -> eval_statement config otherwise cf ctx)
| Some (_, tgt) -> eval_statement config tgt cf ctx)
| VSymbolic sv ->
(* Expand the symbolic value - may lead to branching *)
diff --git a/flake.lock b/flake.lock
index 94159200..77e6546b 100644
--- a/flake.lock
+++ b/flake.lock
@@ -8,11 +8,11 @@
"rust-overlay": "rust-overlay"
},
"locked": {
- "lastModified": 1702401937,
- "narHash": "sha256-PHm8BLp2S5Q1iaKOJOrn6/5nuQfxzwUcIFEgXJzNhBM=",
+ "lastModified": 1702461610,
+ "narHash": "sha256-9eHPrAExrMCiOm/yylwxuPFL9zyUoiBkajFTu1d1tWc=",
"owner": "aeneasverif",
"repo": "charon",
- "rev": "45fd166933d7d30e73eae8150192ff4cc1e123df",
+ "rev": "17c2aaa7cb05c0f06d3177b020eb6ba8b0b1f950",
"type": "github"
},
"original": {