summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bytecomp/bytegen.ml8
-rw-r--r--bytecomp/translcore.ml16
2 files changed, 12 insertions, 12 deletions
diff --git a/bytecomp/bytegen.ml b/bytecomp/bytegen.ml
index a3416a1a4..b412be4df 100644
--- a/bytecomp/bytegen.ml
+++ b/bytecomp/bytegen.ml
@@ -114,7 +114,7 @@ let rec size_of_lambda = function
| Llet(str, id, arg, body) ->
size_of_lambda body
| _ ->
- fatal_error "Codegen.size_of_lambda"
+ fatal_error "Bytegen.size_of_lambda"
(**** Compilation of a lambda expression ****)
@@ -148,7 +148,7 @@ let rec comp_expr env exp sz cont =
Kenvacc(pos) :: cont
with Not_found ->
Ident.print id; print_newline();
- fatal_error "Codegen.comp_expr: var"
+ fatal_error "Bytegen.comp_expr: var"
end
| Lconst cst ->
Kconst cst :: cont
@@ -316,7 +316,7 @@ let rec comp_expr env exp sz cont =
| Parrayrefu kind -> Kgetvectitem
| Parraysetu kind -> Ksetvectitem
| Pbittest -> Kccall("bitvect_test", 2)
- | _ -> fatal_error "Codegen.comp_expr: prim" in
+ | _ -> fatal_error "Bytegen.comp_expr: prim" in
comp_args env args sz (instr :: cont)
| Lcatch(body, Lstaticfail) ->
comp_expr env body sz cont
@@ -395,7 +395,7 @@ let rec comp_expr env exp sz cont =
let pos = Ident.find_same id env.ce_stack in
comp_expr env expr sz (Kassign(sz - pos) :: cont)
with Not_found ->
- fatal_error "Codegen.comp_expr: assign"
+ fatal_error "Bytegen.comp_expr: assign"
end
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 *)