Skip to content

Bytecode miscompilation of recursive definition of empty first class module  #12153

@ncik-roberts

Description

@ncik-roberts

This produces segfaulting bytecode with trunk's ocamlc, but not 4.14.1. I haven't bisected the cause yet.

module type S = sig end;;

let rec k =
  (module struct end : S)

Notably, these variations do not segfault:

module type S = sig end;;

let k =
  (module struct end : S)
module type S = sig val x : int end;;

let rec k =
  (module struct let x = 3 end : S)

ocamlopt does not produce segfaulting code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions