Version française
Home     About     Download     Resources     Contact us    
Browse thread
Bug in ocamlc or in ocamlrun.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Sebastian Egner <sebastian.egner@p...>
Subject: Re: [Caml-list] Bug in ocamlc or in ocamlrun.
Besides the point or not, here is a much simpler version of
Marc's program which also segfaults (ocamlc 3.09.1), and 
probably due to the same reason:

---

module type Aut =
  sig 
    type t 
    val f : t -> t 
  end

module Map(A : Aut) =
  struct
    type t = A.t list
    let f = List.map A.f (* => Segmentation fault *)
(*  let f x = List.map A.f x *) (* => Stack overflow (correct) *)
  end

module rec M : (Aut with type t = int) =
  struct
    type t
    let f x = 
      match MapM.f [x] with 
      | [y] -> y 
      | _   -> assert false
  end
and MapM : (Aut with type t = M.t list) = 
  Map(M)

open M;;
M.f 0

---

Sebastian