Skip to content
Snippets Groups Projects
Commit 8d4a45fa authored by Julien Signoles's avatar Julien Signoles
Browse files

[E-ACSL] fixed bug #1473 about removing the default project on a corner case

parent cdbacc6c
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
- loop invariant - loop invariant
- loop variant - loop variant
- grep "not_yet" *.ml - grep "not_yet" *.ml
- logical shift (at least in non GMP mode)
######## ########
# CODE # # CODE #
...@@ -84,3 +85,4 @@ function call ...@@ -84,3 +85,4 @@ function call
- inclure exemple du E-ACSL Reference Manual - inclure exemple du E-ACSL Reference Manual
- inclure exemple du E-ACSL User Manual - inclure exemple du E-ACSL User Manual
- test arith.i: mettre les exemples du ACSL manual about div and modulo - test arith.i: mettre les exemples du ACSL manual about div and modulo
- currently, tests require a non-free version of Frama-C
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
# E-ACSL: the Whole E-ACSL plug-in # E-ACSL: the Whole E-ACSL plug-in
############################################################################### ###############################################################################
-* E-ACSL [2013/09/04] Fix bug when mixing -e-acsl-prepare and
running E-ACSL in another project (bts #!1473).
-* E-ACSL [2013/06/26] Fix crash with typedef on pointer types. -* E-ACSL [2013/06/26] Fix crash with typedef on pointer types.
- E-ACSL [2013/06/21] Fewer unknown locations. - E-ACSL [2013/06/21] Fewer unknown locations.
-* E-ACSL [2013/06/18] Fixed bug when generating RTEs on the E-ACSL -* E-ACSL [2013/06/18] Fixed bug when generating RTEs on the E-ACSL
......
...@@ -43,7 +43,11 @@ let check = ...@@ -43,7 +43,11 @@ let check =
(Datatype.func Datatype.unit Datatype.bool) (Datatype.func Datatype.unit Datatype.bool)
check check
let extended_ast_project: Project.t option ref = ref None type extended_project =
| To_be_extended
| Already_extended of Project.t option (* None = keep the current project *)
let extended_ast_project: extended_project ref = ref To_be_extended
let unmemoized_extend_ast () = let unmemoized_extend_ast () =
let extend () = let extend () =
...@@ -89,27 +93,34 @@ E-ACSL is going to work on a copy."; ...@@ -89,27 +93,34 @@ E-ACSL is going to work on a copy.";
Kernel.Files.set [ tmpfile ]; Kernel.Files.set [ tmpfile ];
extend ()) extend ())
(); ();
prj Some prj
end else begin end else begin
extend (); extend ();
Project.current () None
end end
let extend_ast () = match !extended_ast_project with let extend_ast () = match !extended_ast_project with
| None -> | To_be_extended ->
let prj = unmemoized_extend_ast () in let prj = unmemoized_extend_ast () in
extended_ast_project := Some prj; extended_ast_project := Already_extended prj;
prj (match prj with
| Some prj -> | None -> Project.current ()
| Some prj -> prj)
| Already_extended None ->
Project.current ()
| Already_extended(Some prj) ->
prj prj
let apply_on_e_acsl_ast f x = let apply_on_e_acsl_ast f x =
let tmp_prj = extend_ast () in let tmp_prj = extend_ast () in
let res = Project.on tmp_prj f x in let res = Project.on tmp_prj f x in
if not (Project.equal tmp_prj (Project.current ())) then begin (match !extended_ast_project with
extended_ast_project := None; | To_be_extended -> assert false
Project.remove ~project:tmp_prj () | Already_extended None -> ()
end; | Already_extended (Some prj) ->
assert (Project.equal prj tmp_prj);
extended_ast_project := To_be_extended;
Project.remove ~project:tmp_prj ());
res res
module Resulting_projects = module Resulting_projects =
......
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