File tree Expand file tree Collapse file tree 2 files changed +20
-12
lines changed Expand file tree Collapse file tree 2 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -501,14 +501,17 @@ and compile_general_cases
501
501
(* * see #2413
502
502
In general, we know it is last call,
503
503
there is no need to print [break];
504
- there is an exception when two conditions meet:
505
- - should_break does not imply
506
- There is one case (tailcall)
507
- where [should_break] inferred false while our
508
- exit engine could not infer
509
- - has_exit
504
+ But we need make sure the last call lambda does not
505
+ have `(exit ..)` due to we pass should_return from Lstaticcath downwards
506
+ Since this is a rough approximation, some `(exit ..)` does not destroy
507
+ last call property, we use exiting should_break to improve preciseness
508
+ (and it indeed help catch more cases)
509
+
510
+ - tailcall or not does not matter, if it is the tailcall
511
+ break still should not be printed (it will be continuned)
510
512
*)
511
- should_break && (Lam_exit_code. has_exit lam)
513
+ should_break &&
514
+ (Lam_exit_code. has_exit lam)
512
515
in
513
516
{J. switch_case ;
514
517
switch_body = switch_block, should_break
Original file line number Diff line number Diff line change @@ -97880,12 +97880,17 @@ and compile_general_cases
97880
97880
(** see #2413
97881
97881
In general, we know it is last call,
97882
97882
there is no need to print [break];
97883
- there is an exception when two conditions meet:
97884
- - should_break does not imply
97885
- There is one case
97886
- where [should_break]for [tailcall], we get [should_break = false]
97883
+ But we need make sure the last call lambda does not
97884
+ have `(exit ..)` due to we pass should_return from Lstaticcath downwards
97885
+ Since this is a rough approximation, some `(exit ..)` does not destroy
97886
+ last call property, we use exiting should_break to improve preciseness
97887
+ (and it indeed help catch more cases)
97888
+
97889
+ - tailcall or not does not matter, if it is the tailcall
97890
+ break still should not be printed (it will be continuned)
97887
97891
*)
97888
- should_break && (Lam_exit_code.has_exit lam)
97892
+ should_break &&
97893
+ (Lam_exit_code.has_exit lam)
97889
97894
in
97890
97895
{J.switch_case ;
97891
97896
switch_body = switch_block, should_break
You can’t perform that action at this time.
0 commit comments