Skip to content

Commit

Permalink
fix initialization order
Browse files Browse the repository at this point in the history
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/fastclass@5919 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information
Jacques Garrigue committed Nov 14, 2003
1 parent d4fa3e5 commit 8614181
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bytecomp/translclass.ml
Expand Up @@ -193,14 +193,14 @@ let build_object_init_0 cl_table params cl copy_env subst_env top ids =
let obj_init = subst_env env obj_init in
let obj_init =
if top then obj_init else
let i = ref 0 in
List.fold_left
(fun init (obj_init, env_init, _) ->
incr i;
let i = ref (List.length inh_init + 1) in
List.fold_right
(fun (obj_init, env_init, _) init ->
decr i;
Llet(Strict, obj_init,
Lapply(Lvar env_init, [Lprim(Pfield !i, [Lvar env])]),
init))
obj_init inh_init
inh_init obj_init
in
(inh_init, lfunction [env] obj_init)

Expand Down

0 comments on commit 8614181

Please sign in to comment.