summaryrefslogtreecommitdiff
path: root/bytecomp/translobj.ml
diff options
context:
space:
mode:
authorJérôme Vouillon <Jerome.Vouillon@pps.jussieu.fr>1997-03-12 10:30:19 +0000
committerJérôme Vouillon <Jerome.Vouillon@pps.jussieu.fr>1997-03-12 10:30:19 +0000
commit59398f662a438ee08147583c14f9376744b8c5b0 (patch)
tree5690cb8e19e1b016590ac954a0d5707c465b4e2a /bytecomp/translobj.ml
parent79240af6cc14f61b84dc77d3fff602ddc17b975f (diff)
downloadocaml-59398f662a438ee08147583c14f9376744b8c5b0.tar.gz
Les index associes aux methodes doivent etre lies par un let strict et
non un alias... git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1374 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'bytecomp/translobj.ml')
-rw-r--r--bytecomp/translobj.ml24
1 files changed, 11 insertions, 13 deletions
diff --git a/bytecomp/translobj.ml b/bytecomp/translobj.ml
index c4705cfb62..70fc06edb2 100644
--- a/bytecomp/translobj.ml
+++ b/bytecomp/translobj.ml
@@ -44,20 +44,18 @@ let reset_labels () =
let string s = Lconst (Const_base (Const_string s))
-let transl_init kind labels expr =
- if labels = [] then
+let transl_label_init expr =
+ if !used_methods = [] then
expr
else
- let init = Ident.create kind in
- Llet(Alias, init, oo_prim kind,
- List.fold_right
- (fun (lab, id) expr ->
- Llet(Alias, id, Lapply(Lvar init, [string lab]), expr))
- labels
- expr)
-
-let transl_label_init expr =
- let new_method = Ident.create "new_method" in
- let expr' = transl_init "new_method" !used_methods expr in
+ let init = Ident.create "new_method" in
+ let expr' =
+ Llet(StrictOpt, init, oo_prim "new_method",
+ List.fold_right
+ (fun (lab, id) expr ->
+ Llet(StrictOpt, id, Lapply(Lvar init, [string lab]), expr))
+ !used_methods
+ expr)
+ in
reset_labels ();
expr'