You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 6376 Reporter:@lpw25 Assigned to:@garrigue Status: closed (set by @xavierleroy on 2015-12-11T18:26:39Z) Resolution: fixed Priority: normal Severity: minor Version: 4.02.0+dev Fixed in version: 4.02.0+dev Category: typing
Bug description
Destructive module substitution does not check whether the module being replaced is used in an alias, which means you can create aliases to extended paths. Using the usual trick to convert module types into modules, we obtain a segmentation fault:
OCaml version 4.02.0+dev4-2014-04-03
# module type Alias = sig module N : sig end module M = N end;;
module type Alias = sig module N : sig end module M = N end
# module F (X : sig end) = struct type t end;;
module F : functor (X : sig end) -> sig type t end
# module type A = Alias with module N := F(List);;
module type A = sig module M = F(List) end
# module rec Bad : A = Bad;;
Segmentation fault
The text was updated successfully, but these errors were encountered:
Well spotted!
I completely overlooked the fact one could corrupt a module alias this way.
Fixed in trunk, revision 14650, in Includemod.try_modtypes.
Just cause an error in that case (a specialized signature should refine
the original one, and this is impossible here).
Original bug ID: 6376
Reporter: @lpw25
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2015-12-11T18:26:39Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.0+dev
Fixed in version: 4.02.0+dev
Category: typing
Bug description
Destructive module substitution does not check whether the module being replaced is used in an alias, which means you can create aliases to extended paths. Using the usual trick to convert module types into modules, we obtain a segmentation fault:
The text was updated successfully, but these errors were encountered: