Skip to content
Snippets Groups Projects
Commit f2146460 authored by Thibault Martin's avatar Thibault Martin Committed by Allan Blanchard
Browse files

Fix expr_to_term

parent a336be9b
No related branches found
No related tags found
No related merge requests found
...@@ -50,8 +50,8 @@ let treat_fct check fct = ...@@ -50,8 +50,8 @@ let treat_fct check fct =
| _ -> false) | _ -> false)
stmts stmts
in in
let ensures = (List.hd (Annotations.funspec fct).spec_behavior).b_post_cond let ensures = (List.hd (Annotations.funspec fct).spec_behavior).b_post_cond in
in let ensures = List.filter (fun (kind,_) -> kind = Normal) ensures in
(* A bit fragile, but should do the trick as long as the test itself does (* A bit fragile, but should do the trick as long as the test itself does
not get too complicated (regarding the C code at least). *) not get too complicated (regarding the C code at least). *)
if not (List.length stmts = List.length ensures) then if not (List.length stmts = List.length ensures) then
...@@ -70,6 +70,7 @@ let treat_fct_pred fct = ...@@ -70,6 +70,7 @@ let treat_fct_pred fct =
stmts stmts
in in
let ensures = (List.hd (Annotations.funspec fct).spec_behavior).b_post_cond in let ensures = (List.hd (Annotations.funspec fct).spec_behavior).b_post_cond in
let ensures = List.filter (fun (kind,_) -> kind = Normal) ensures in
if List.length stmts <> List.length ensures then if List.length stmts <> List.length ensures then
Kernel.fatal "ill-formed test in function %a" Kernel_function.pretty fct; Kernel.fatal "ill-formed test in function %a" Kernel_function.pretty fct;
List.iter2 (check_expr_pred fct) stmts ensures; List.iter2 (check_expr_pred fct) stmts ensures;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment