Skip to content

Commit 3ee650c

Browse files
lpw25mshinwell
authored andcommitted
flambda-backend: Fix soundness bug in include functor (oxcaml#820)
1 parent 2f57378 commit 3ee650c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

typing/typemod.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ let extract_sig_open env loc mty =
144144
(* Extract the signature of a functor's body, using the provided [sig_acc]
145145
signature to fill in names from its parameter *)
146146
let extract_sig_functor_open funct_body env loc mty sig_acc =
147+
let sig_acc = List.rev sig_acc in
147148
match Env.scrape_alias env mty with
148149
| Mty_functor (Named (param, mty_param),mty_result) as mty_func ->
149150
let sg_param =
@@ -154,7 +155,7 @@ let extract_sig_functor_open funct_body env loc mty sig_acc =
154155
let coercion =
155156
try
156157
Includemod.include_functor_signatures ~mark:Mark_both env
157-
(List.rev sig_acc) sg_param
158+
sig_acc sg_param
158159
with Includemod.Error msg ->
159160
raise (Error(loc, env, Not_included_functor msg))
160161
in

0 commit comments

Comments
 (0)