let doInstr stmt (i: instr) (d: t) =
!Db.progress ();
CilE.start_stmt (Kstmt stmt);
let reachable,reachables = reachables d in
let result =
if (not reachable) then
Dataflow.Done d
else begin
(* update current statement *)
match i with
| Set (lv,exp,_loc) ->
Dataflow.Post
(fun _state ->
CilE.start_stmt (Kstmt stmt);
let result =
{
counter_unroll = 0;
value =
ref
(State_set.fold
(fun state_value acc ->
State_set.add
(do_assign
~with_alarms:(warn_all_quiet_mode ())
state_value
lv
exp)
acc)
reachables
State_set.empty) }
in
CilE.end_stmt ();
result)
| Call (None,
{enode = Lval (Var {vname="__builtin_va_start"},NoOffset)},
[{enode = Lval lv}],_loc) ->
Dataflow.Post
(fun _state ->
CilE.start_stmt (Kstmt stmt);
let result =
{
counter_unroll = 0;
value =
ref (State_set.fold
(fun state_value acc ->
State_set.add
(do_assign_abstract_value
~with_alarms:(warn_all_quiet_mode ())
~former_state:state_value
state_value
lv
Cvalue_type.V.top_int) acc)
reachables
State_set.empty)}
in
CilE.end_stmt ();
result)
| Call (lval_to_assign,funcexp,argl,_loc) ->
Dataflow.Done
{
counter_unroll = 0;
value =
ref (interp_call stmt lval_to_assign funcexp argl reachables)
}
| Asm _ ->
Value_parameters.warning ~once:true ~current:true
"assuming assembly code has no effects in function %t"
pretty_current_cfunction_name;
Dataflow.Default
| Skip _ ->
Dataflow.Default
| Code_annot (_,_) -> (* processed in dostmt from Db *)
Dataflow.Default
end
in
CilE.end_stmt ();
result