You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Test (exp, false), if_true_next_false_next_n, if_false_next_ps @ cartesian_concat_paths if_true_next_ps if_true_next_false_next_ps) (* concat two different path families to same false node *)
(* get e2 from edge because recursive next returns it there *)
351
-
let (e2, if_false_next_true_next_n, if_false_next_false_next_n) = partition_if_next (next if_false_next_n) in
352
-
ifis_equiv_chain if_true_next_n if_false_next_true_next_n then
329
+
let (e2, (if_false_next_true_next_n, if_false_next_true_next_ps), (if_false_next_false_next_n, if_false_next_false_next_ps)) = partition_if_next (next if_false_next_n) in
330
+
ifNode.equal if_true_next_n if_false_next_true_next_n then
353
331
let exp =BinOp (LOr, e, e2, intType) in
354
332
Some [
355
-
(Test (exp, true), if_true_next_n);
356
-
(Test (exp, false), if_false_next_false_next_n)
333
+
(Test (exp, true), if_false_next_true_next_n, if_true_next_ps @ cartesian_concat_paths if_false_next_ps if_false_next_true_next_ps); (* concat two different path families to same true node *)
(Assign (v_true, exp), if_true_next_next_n, cartesian_concat_paths if_true_next_ps if_true_next_next_ps @ cartesian_concat_paths if_false_next_ps if_false_next_next_ps) (* concat two different path families with same variable to same node *)
392
370
]
393
371
|_, _ -> None
394
372
else
@@ -407,14 +385,30 @@ module Intra (ArgIntra: SIntraOpt) (Arg: S):
407
385
struct
408
386
includeArg
409
387
388
+
(** Starting from ARG node [node], follow CFG path [p] to the resulting ARG node.
389
+
Returns multiple ARG nodes if ARG contains path-sensitivity splits on the same CFG path. *)
Edge.equal (Edge.embed e) e' &&Node0.equal to_n (Node.cfgnode to_node)
397
+
) (Arg.next node)
398
+
in
399
+
follow node' p'
400
+
410
401
letnextnode=
411
-
letopenGobOption.Syntaxin
402
+
letopenGobList.Syntaxin
412
403
matchArgIntra.next_opt (Node.cfgnode node) with
413
404
|None -> Arg.next node
414
405
|Somenext ->
415
406
next
416
-
|>BatList.filter_map (fun (e, to_n) ->
417
-
let+ to_node =Node.move_opt node to_n in
407
+
|>BatList.concat_map (fun (e, to_n, p) ->
408
+
let* p in
409
+
let+ to_node = follow node p in
410
+
assert (Node0.equal to_n (Node.cfgnode to_node)); (* should always hold by follow filter above *)
418
411
(Edge.embed e, to_node)
419
412
)
413
+
|>BatList.unique_cmp ~cmp:[%ord: Edge.t *Node.t] (* after following paths, there may be duplicates because same ARG node can be reached via same ARG edge via multiple uncilled CFG paths *)(* TODO: avoid generating duplicates in the first place? *)
βββββ Test (a && b,false) ββββββββββββββββββββββββββββββββββββ Test (a && b,false) βββββ
βββββ Test (a && b,false) ββββββββββββββββββββββββββββββββββββ Test (a && b,false) βββββ
0 commit comments