@@ -79,6 +79,13 @@ let change_tail_type_in_try
79
79
Maybe_tail_is_return Tail_in_try
80
80
| Not_tail | Maybe_tail_is_return Tail_in_try
81
81
-> x
82
+ let in_staticcatch (x : Lam_compile_context.tail_type )
83
+ : Lam_compile_context.tail_type =
84
+ match x with
85
+ | Maybe_tail_is_return (Tail_with_name ({in_staticcatch = false } as x))
86
+ ->
87
+ Maybe_tail_is_return (Tail_with_name ({ x with in_staticcatch = true }))
88
+ | _ -> x
82
89
83
90
(* let change_tail_type_in_static
84
91
(x : Lam_compile_context.tail_type)
@@ -745,7 +752,7 @@ and compile_staticcatch (lam : Lam.t) (lambda_cxt : Lam_compile_context.t)=
745
752
let code_table, body = flatten_nested_caches lam in
746
753
let exit_id = Ext_ident. create_tmp ~name: " exit" () in
747
754
match lambda_cxt.continuation, code_table with
748
- | EffectCall (Maybe_tail_is_return (Tail_with_name ({in_staticcatch = false } as z)) ),
755
+ | EffectCall (Maybe_tail_is_return (Tail_with_name ({in_staticcatch = false } )) as tail_type ),
749
756
[ code_table ]
750
757
(* tail position and only one exit code *)
751
758
when Lam_compile_context. no_static_raise_in_handler code_table
@@ -758,7 +765,7 @@ and compile_staticcatch (lam : Lam.t) (lambda_cxt : Lam_compile_context.t)=
758
765
{lambda_cxt with
759
766
jmp_table = jmp_table ;
760
767
continuation =
761
- EffectCall (Maybe_tail_is_return ( Tail_with_name { z with in_staticcatch = true }) )
768
+ EffectCall (in_staticcatch tail_type )
762
769
} in
763
770
764
771
let lbody = compile_lambda new_cxt body in
0 commit comments