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

[E-ACSL] new option -e-acsl-full-mmodel to monitor all pointers

parent 36586faf
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
# KNOWN BUGS # # KNOWN BUGS #
############## ##############
- see BTS
- comparaisons qui aboutissent à du C incorrect - comparaisons qui aboutissent à du C incorrect
==> comparaison de chaînes litérales ==> comparaison de chaînes litérales
(voir tests other_constants.i et comparison.i) (voir tests other_constants.i et comparison.i)
......
...@@ -76,6 +76,13 @@ module Gmp_only = ...@@ -76,6 +76,13 @@ module Gmp_only =
let help = "" let help = ""
end) end)
module Full_mmodel =
False
(struct
let option_name = "-e-acsl-full-mmodel"
let help = ""
end)
let () = Plugin.set_group help let () = Plugin.set_group help
module Version = module Version =
False False
......
...@@ -29,6 +29,7 @@ module Run: Bool ...@@ -29,6 +29,7 @@ module Run: Bool
module Valid: Bool module Valid: Bool
module Prepare: Bool module Prepare: Bool
module Gmp_only: Bool module Gmp_only: Bool
module Full_mmodel: Bool
module Project_name: String module Project_name: String
val must_visit: unit -> bool val must_visit: unit -> bool
......
...@@ -532,14 +532,17 @@ and must_model_exp ?kf ?stmt e = match e.enode with ...@@ -532,14 +532,17 @@ and must_model_exp ?kf ?stmt e = match e.enode with
| UnOp _ | Const _ | SizeOf _ | SizeOfE _ | SizeOfStr _ | AlignOf _ | UnOp _ | Const _ | SizeOf _ | SizeOfE _ | SizeOfStr _ | AlignOf _
| AlignOfE _ -> assert false | AlignOfE _ -> assert false
let must_model_vi ?kf ?stmt vi = let must_model_vi ?kf ?stmt vi =
Error.generic_handle (must_model_vi ?kf ?stmt) false vi Options.Full_mmodel.get ()
|| Error.generic_handle (must_model_vi ?kf ?stmt) false vi
let must_model_lval ?kf ?stmt lv = let must_model_lval ?kf ?stmt lv =
Error.generic_handle (must_model_lval ?kf ?stmt) false lv Options.Full_mmodel.get ()
|| Error.generic_handle (must_model_lval ?kf ?stmt) false lv
let old_must_model_vi bhv ?kf ?stmt vi = let old_must_model_vi bhv ?kf ?stmt vi =
must_model_vi ?kf ?stmt (Cil.get_original_varinfo bhv vi) Options.Full_mmodel.get ()
|| must_model_vi ?kf ?stmt (Cil.get_original_varinfo bhv vi)
(* (*
Local Variables: Local Variables:
......
...@@ -127,7 +127,7 @@ class e_acsl_visitor prj generate = object (self) ...@@ -127,7 +127,7 @@ class e_acsl_visitor prj generate = object (self)
let cur = Project.current () in let cur = Project.current () in
let selection = let selection =
State_selection.of_list State_selection.of_list
[ Options.Gmp_only.self; Options.Check.self; [ Options.Gmp_only.self; Options.Check.self; Options.Full_mmodel.self;
Kernel.SignedOverflow.self; Kernel.UnsignedOverflow.self; Kernel.SignedOverflow.self; Kernel.UnsignedOverflow.self;
Kernel.SignedDowncast.self; Kernel.UnsignedDowncast.self; Kernel.SignedDowncast.self; Kernel.UnsignedDowncast.self;
Kernel.Machdep.self ] Kernel.Machdep.self ]
...@@ -135,9 +135,6 @@ class e_acsl_visitor prj generate = object (self) ...@@ -135,9 +135,6 @@ class e_acsl_visitor prj generate = object (self)
if generate then Project.copy ~selection ~src:cur prj; if generate then Project.copy ~selection ~src:cur prj;
Cil.DoChildrenPost Cil.DoChildrenPost
(fun f -> (fun f ->
(* reset them at the end to be observationally equivalent to a standard
visitor. *)
if generate then Project.clear ~selection ~project:prj ();
(* extend the main with forward initialization and put it at end *) (* extend the main with forward initialization and put it at end *)
if not (Options.Check.get ()) then begin if not (Options.Check.get ()) then begin
let must_init = let must_init =
...@@ -243,6 +240,9 @@ you must call function `%s' by yourself" ...@@ -243,6 +240,9 @@ you must call function `%s' by yourself"
in in
Project.on prj build_initializer () Project.on prj build_initializer ()
end; end;
(* reset copied states at the end to be observationally equivalent to a
standard visitor. *)
if generate then Project.clear ~selection ~project:prj ();
f) f)
method vglob_aux = function method vglob_aux = function
......
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