Skip to content

Commit 20f2c7f

Browse files
committed
Deduplicate stack ARG InlineReturn edges based on InlineEntry lval and args
1 parent 62e97b9 commit 20f2c7f

File tree

5 files changed

+199
-194
lines changed

5 files changed

+199
-194
lines changed

src/arg/myARG.ml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,27 @@ struct
171171
| _ -> None
172172
)
173173
in
174+
let entry_lval_args =
175+
Arg.next call_n
176+
(* filter because infinite loops starting with function call
177+
will have another Neg(1) edge from the head *)
178+
|> List.filter_map (fun (edge, to_n) ->
179+
match edge with
180+
| InlineEntry (lval, _, args) -> Some (lval, args)
181+
| _ -> None
182+
)
183+
in
174184
Arg.next n
175185
|> List.filter_map (fun (edge, to_n) ->
176-
if BatList.mem_cmp Arg.Node.compare to_n call_next then (
177-
let to_n' = to_n :: call_stack in
178-
Some (edge, to_n')
179-
)
180-
else
181-
None
186+
match edge with
187+
| InlineReturn (lval, _, args) -> (* TODO: should also check fundec component equality? might be different for ambiguous calls via function pointer *)
188+
if BatList.mem_cmp Arg.Node.compare to_n call_next && BatList.mem_cmp [%ord: CilType.Lval.t option * CilType.Exp.t list] (lval, args) entry_lval_args then (
189+
let to_n' = to_n :: call_stack in
190+
Some (edge, to_n')
191+
)
192+
else
193+
None
194+
| _ -> assert false
182195
)
183196
end
184197
| _ ->

tests/sv-comp/basic/if_trier_exclude_multiple_false-unreach-call.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,5 @@ int main()
2525
__VERIFIER_assert(x != 1);
2626
}
2727
}
28-
// TODO: double InlineReturn edge in two first cases?
2928
return 0;
3029
}

0 commit comments

Comments
 (0)