summaryrefslogtreecommitdiff
path: root/src/FunsAnalysis.ml
diff options
context:
space:
mode:
authorSidney Congard2022-07-13 15:56:24 +0200
committerSidney Congard2022-07-13 15:56:24 +0200
commit8f14d69ae6683e58e1387ffe38ca3612e0530465 (patch)
treef028dcaba398cc5815875b2235dedfb167b7e912 /src/FunsAnalysis.ml
parenteebedf86db68c240fe16cfd74af2cc462b0d9cf9 (diff)
Apply small changes from the PR
Diffstat (limited to 'src/FunsAnalysis.ml')
-rw-r--r--src/FunsAnalysis.ml3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/FunsAnalysis.ml b/src/FunsAnalysis.ml
index 5a623450..b1b8ccc2 100644
--- a/src/FunsAnalysis.ml
+++ b/src/FunsAnalysis.ml
@@ -58,6 +58,8 @@ let analyze_module (m : llbc_module) (funs_map : fun_decl FunDeclId.Map.t)
method may_fail b =
(* The fail flag is disabled for globals : the global body is
* normalised into its declaration, which is always successful.
+ * (we check that it is successful in the extracted code: if it is
+ * not, it leads to a type-checking error in the generated files)
*)
if f.is_global then () else
can_fail := !can_fail || b
@@ -96,6 +98,7 @@ let analyze_module (m : llbc_module) (funs_map : fun_decl FunDeclId.Map.t)
super#visit_Loop env loop
end
in
+ assert (not f.is_global || not use_state);
(match f.body with
| None ->
(* Opaque function *)