summaryrefslogtreecommitdiffstats
path: root/bytecomp/translcore.ml
diff options
context:
space:
mode:
Diffstat (limited to 'bytecomp/translcore.ml')
-rw-r--r--bytecomp/translcore.ml16
1 files changed, 8 insertions, 8 deletions
diff --git a/bytecomp/translcore.ml b/bytecomp/translcore.ml
index ab06c8516..2dc0594fa 100644
--- a/bytecomp/translcore.ml
+++ b/bytecomp/translcore.ml
@@ -226,16 +226,16 @@ let transl_primitive p =
let check_recursive_lambda id lam =
let rec check_top = function
Lfunction(params, body) as funct -> true
- | Lprim(Pmakeblock(tag, mut), args) -> List.for_all check args
- | Llet(str, id, arg, body) -> check arg & check_top body
+ | Lprim(Pmakeblock(tag, mut), args) -> List.for_all check_comp args
+ | Llet(str, id, arg, body) -> check_comp arg & check_top body
| _ -> false
- and check = function
- Lvar _ -> true
+ and check_comp = function
+ Lvar v -> true
| Lconst cst -> true
- | Lfunction(params, body) -> true
- | Llet(_, _, arg, body) -> check arg & check body
- | Lprim(Pmakeblock(tag, mut), args) -> List.for_all check args
- | lam -> not(IdentSet.mem id (free_variables lam))
+ | Lfunction(params, body) as funct -> true
+ | Lprim(Pmakeblock(tag, mut), args) -> List.for_all check_comp args
+ | Llet(str, id, arg, body) -> check_comp arg & check_comp body
+ | _ -> false
in check_top lam
(* To propagate structured constants *)