Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Replace Obj.magic trick by a recursive definition

  • Loading branch information...
commit 3ae4a352f49feb7f4b59e1bcf532ae49272d5e7f 1 parent f730821
@kerneis kerneis authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/mergecil.ml
View
5 src/mergecil.ml
@@ -124,9 +124,8 @@ let mkSelfNode (eq: (int * string, 'a node) H.t) (* The equivalence table *)
(syn: (string, 'a node) H.t) (* The synonyms table *)
(fidx: int) (name: string) (data: 'a)
(l: (location * int) option) =
- let res = { nname = name; nfidx = fidx; ndata = data; nloc = l;
- nrep = Obj.magic 1; nmergedSyns = false; } in
- res.nrep <- res; (* Make the self cycle *)
+ let rec res = { nname = name; nfidx = fidx; ndata = data; nloc = l;
+ nrep = res; nmergedSyns = false; } in
H.add eq (fidx, name) res; (* Add it to the proper table *)
if mergeSynonyms && not (prefix "__anon" name) then
H.add syn name res;
Please sign in to comment.
Something went wrong with that request. Please try again.