Skip to content
Snippets Groups Projects
Commit 3481ffbf authored by David Bühler's avatar David Bühler
Browse files

[inout] Rewrites [specialize_state_on_call] with the new Eva API.

In the Eva request, filters the possible callstacks to only keep those from the
given statement call.
parent e4671bfc
No related branches found
No related tags found
No related merge requests found
...@@ -37,27 +37,13 @@ let fold_implicit_initializer typ = ...@@ -37,27 +37,13 @@ let fold_implicit_initializer typ =
let specialize_state_on_call ?stmt kf = let specialize_state_on_call ?stmt kf =
match stmt with match stmt with
| Some ({ skind = Instr (Call (_, _, l, _)) } as stmt) -> | None -> Eva.Results.(at_start_of kf |> get_cvalue_model)
let at_stmt = Db.Value.get_stmt_state stmt in | Some stmt ->
if Cvalue.Model.is_top at_stmt then let filter = function
Cvalue.Model.top (* can occur with -no-results-function option *) | (_, Kstmt s) :: _ -> Cil_datatype.Stmt.equal s stmt
else !Db.Value.add_formals_to_state at_stmt kf l | _ -> false
| Some in
({skind = Eva.Results.(at_start_of kf |> filter_callstack filter |> get_cvalue_model)
Instr(Local_init(v, ConsInit(_,args,kind),_))} as stmt) ->
let at_stmt = Db.Value.get_stmt_state stmt in
if Cvalue.Model.is_top at_stmt then
Cvalue.Model.top
else begin
let args =
match kind with
| Constructor -> Cil.mkAddrOfVi v :: args
| Plain_func -> args
in
!Db.Value.add_formals_to_state at_stmt kf args
end
| _ -> Db.Value.get_initial_state kf
class virtual ['a] cumulative_visitor = object class virtual ['a] cumulative_visitor = object
inherit frama_c_inplace as self inherit frama_c_inplace as self
......
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