Skip to content
Snippets Groups Projects
Commit 37b7aec4 authored by Andre Maroneze's avatar Andre Maroneze
Browse files

Merge branch 'fix/eva/protect' into 'master'

[Eva] Fixes function Value_util.protect, which can be called multiple times.

See merge request frama-c/frama-c!3487
parents 8af51a89 d271d82b
No related branches found
No related tags found
No related merge requests found
...@@ -111,17 +111,19 @@ let protect_only_once = ref true ...@@ -111,17 +111,19 @@ let protect_only_once = ref true
let protect f ~cleanup = let protect f ~cleanup =
let catch () = !protect_only_once && not (Kernel.SaveState.is_empty ()) in let catch () = !protect_only_once && not (Kernel.SaveState.is_empty ()) in
let cleanup () =
Value_parameters.feedback ~once:true "Clean up and save partial results.";
try cleanup ()
with e ->
protect_only_once := false;
raise e
in
try f (); try f ();
with with
| Log.AbortError _ | Log.AbortFatal _ | Log.FeatureRequest _ | Log.AbortError _ | Log.AbortFatal _ | Log.FeatureRequest _
| Sys.Break as e when catch () -> | Sys.Break as e when catch () ->
try cleanup ();
Value_parameters.feedback ~once:true "Clean up and save partial results."; raise e
cleanup ();
raise e;
with e ->
protect_only_once := false;
raise e
let register_new_var v typ = let register_new_var v typ =
if Cil.isFunctionType typ then if Cil.isFunctionType typ then
......
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