From 5b7fc57cdc6bc5cff8373e6aa8df383278c9cf63 Mon Sep 17 00:00:00 2001 From: Escherichia Date: Tue, 4 Jun 2024 15:27:33 +0200 Subject: Propagated changes to statement from Charon (#223) Co-authored-by: Escherichia Co-authored-by: Nadrieril --- compiler/InterpreterStatements.ml | 1 + compiler/PrePasses.ml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler') diff --git a/compiler/InterpreterStatements.ml b/compiler/InterpreterStatements.ml index 5ddc1ed8..283a711d 100644 --- a/compiler/InterpreterStatements.ml +++ b/compiler/InterpreterStatements.ml @@ -1021,6 +1021,7 @@ and eval_statement_raw (config : config) (st : statement) : stl_cm_fun = let eval_loop_body = eval_statement config loop_body in InterpreterLoops.eval_loop config st.span eval_loop_body ctx | Switch switch -> eval_switch config st.span switch ctx + | Error s -> craise __FILE__ __LINE__ st.span s and eval_global (config : config) (span : Meta.span) (dest : place) (gid : GlobalDeclId.id) (generics : generic_args) : stl_cm_fun = diff --git a/compiler/PrePasses.ml b/compiler/PrePasses.ml index 26141c72..9eb3b712 100644 --- a/compiler/PrePasses.ml +++ b/compiler/PrePasses.ml @@ -100,7 +100,7 @@ let remove_useless_cf_merges (crate : crate) (f : fun_decl) : fun_decl = let rec can_be_moved_aux (must_end_with_exit : bool) (st : statement) : bool = match st.content with | SetDiscriminant _ | Assert _ | Call _ | Break _ | Continue _ | Switch _ - | Loop _ -> + | Loop _ | Error _ -> false | Assign (_, rv) -> ( match rv with -- cgit v1.2.3