@@ -215,7 +215,9 @@ let expr_deps blocks st x e =
215
215
match st.defs.(Var. idx f) with
216
216
| Expr (Closure (params , _ )) when List. length args = List. length params ->
217
217
Hashtbl. add st.applied_functions (x, f) () ;
218
- if not st.fast then List. iter2 ~f: (fun p a -> add_assign_def st p a) params args;
218
+ if st.fast
219
+ then List. iter ~f: (fun a -> do_escape st Escape a) args
220
+ else List. iter2 ~f: (fun p a -> add_assign_def st p a) params args;
219
221
Var.Set. iter (fun y -> add_dep st x y) (Var.Map. find f st.return_values)
220
222
| _ -> () )
221
223
| Closure (l , cont ) ->
@@ -470,8 +472,13 @@ let propagate st ~update approx x =
470
472
if not (Hashtbl. mem st.applied_functions (x, g))
471
473
then (
472
474
Hashtbl. add st.applied_functions (x, g) () ;
473
- if not st.fast
475
+ if st.fast
474
476
then
477
+ List. iter
478
+ ~f: (fun y ->
479
+ Domain. variable_escape ~update ~st ~approx Escape y)
480
+ args
481
+ else
475
482
List. iter2
476
483
~f: (fun p a ->
477
484
add_assign_def st p a;
@@ -593,7 +600,7 @@ let f ~fast p =
593
600
| Values { known; others } ->
594
601
Format. fprintf
595
602
f
596
- " {%a/%b} mut:%b vmut:%b esc:%s"
603
+ " {%a/%b} mut:%b vmut:%b vesc:%s esc:%s"
597
604
(Format. pp_print_list
598
605
~pp_sep: (fun f () -> Format. fprintf f " , " )
599
606
(fun f x ->
@@ -615,6 +622,10 @@ let f ~fast p =
615
622
others
616
623
st.possibly_mutable.(Var. idx x)
617
624
st.variable_possibly_mutable.(Var. idx x)
625
+ (match st.variable_may_escape.(Var. idx x) with
626
+ | Escape -> " Y"
627
+ | Escape_constant -> " y"
628
+ | No -> " n" )
618
629
(match st.may_escape.(Var. idx x) with
619
630
| Escape -> " Y"
620
631
| Escape_constant -> " y"
0 commit comments