Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
"module type of" + recursive modules + functors segfault in bytecode interpreter (4.07 regression) #7787
Original bug ID: 7787
In 4.07 the following code causes a segfault in the bytecode interpreter, trying to read a field of the unit value, unless the "remove_aliases" attribute is added. This appears to work with 4.06.
Thanks to hheuzard and xclerc for help investigating this.
module O (T : sig
let go () =
module T = struct
(* Incidentally, M isn't used in T2, but it doesn't seem to fail if
let _ = ignore (M.go ())
Steps to reproduce
Compile the above program with ocamlc and run it.
Comment author: @mshinwell
The lambda code (for the version without the attribute) is:
Comment author: @trefis
I pushed the rebased patch here: trefis@5f1036f (I'll let Leo do a proper rebase)
For the record, I'm attaching the -dlambda output ocamlc without 1652 nor 1610 (that's remove-aliases.lambda), with only 1652 (broken-dont-remove-aliases) and with both (fixed-dont-remove-aliases).