summaryrefslogtreecommitdiff
path: root/asmcomp/split.ml
diff options
context:
space:
mode:
authorPierre Chambart <pierre.chambart@ocamlpro.com>2016-07-06 18:11:40 +0200
committerPierre Chambart <chambart@users.noreply.github.com>2016-10-28 13:03:59 +0200
commitcadd4c5ba1cfb693c2d5b41acc3cd9d537b33718 (patch)
tree2485770ac3a4b99ee4416f52e4f4192c51dbaf3c /asmcomp/split.ml
parent8cd36d195a0e94b09be4ffe52eb52e84af7bc085 (diff)
downloadocaml-cadd4c5ba1cfb693c2d5b41acc3cd9d537b33718.tar.gz
Add a recursive flag on the Ccatch construct
When this flag is Nonrecursive, we can avoid iterating on various passes. This makes exponential time cases more unlikely.
Diffstat (limited to 'asmcomp/split.ml')
-rw-r--r--asmcomp/split.ml5
1 files changed, 3 insertions, 2 deletions
diff --git a/asmcomp/split.ml b/asmcomp/split.ml
index 437a85e6ba..ec1a52de83 100644
--- a/asmcomp/split.ml
+++ b/asmcomp/split.ml
@@ -165,7 +165,7 @@ let rec rename i sub =
let (new_next, sub_next) = rename i.next (merge_substs sub sub_body i) in
(instr_cons (Iloop(new_body)) [||] [||] new_next,
sub_next)
- | Icatch(handlers, body) ->
+ | Icatch(rec_flag, handlers, body) ->
let new_subst = List.map (fun (nfail, _) -> nfail, ref None)
handlers in
let previous_exit_subst = !exit_subst in
@@ -181,7 +181,8 @@ let rec rename i sub =
let (new_next, sub_next) = rename i.next merged_subst in
let new_handlers = List.map2 (fun (nfail, _) (handler, _) ->
(nfail, handler)) handlers res in
- (instr_cons (Icatch(new_handlers, new_body)) [||] [||] new_next,
+ (instr_cons
+ (Icatch(rec_flag, new_handlers, new_body)) [||] [||] new_next,
sub_next)
| Iexit nfail ->
let r = find_exit_subst nfail in