Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006384OCamlOCaml typingpublic2014-04-29 02:592014-04-29 04:26
Reporterlpw25 
Assigned Togarrigue 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version4.01.0 
Target VersionFixed in Version4.02.0+dev 
Summary0006384: Uncaught Not_found exception with a hidden .cmi file
DescriptionBy hiding a .cmi file you can get an uncaught Not_found exception:

    $ cat a.mli
    type t = Foo | Bar

    $ cat b.mli
    type t = A.t

    $ cat c.mli
    type t = A.t = Foo | Bar

    $ cat d.ml
    let f (x : B.t) =
      match x with
        C.Foo -> true
      | _ -> false

    $ ocamlc a.mli b.mli c.mli

    $ rm a.cmi

    $ ocamlc d.ml
    Fatal error: exception Not_found

The attached patch fixes this bug. The important change is that "complete_constrs" in parmatch.ml uses the type from the constructor instead of from the pattern.

It also cleans up some other code in parmatch.ml to remove some unnecessary checks that a type has a variant/record definition (since that should makes bugs like this less likely).
TagsNo tags attached.
Attached Filespatch file icon hidden-cmi.patch [^] (9,989 bytes) 2014-04-29 03:00 [Show Content]

- Relationships

-  Notes
(0011334)
garrigue (manager)
2014-04-29 04:26

Applied the patch to trunk at revision 14702.

Indeed, there was a lot of garbage now that constructors contain their names.
Thanks for cleaning up that.

- Issue History
Date Modified Username Field Change
2014-04-29 02:59 lpw25 New Issue
2014-04-29 03:00 lpw25 File Added: hidden-cmi.patch
2014-04-29 03:01 lpw25 Description Updated View Revisions
2014-04-29 04:26 garrigue Note Added: 0011334
2014-04-29 04:26 garrigue Status new => resolved
2014-04-29 04:26 garrigue Fixed in Version => 4.02.0+dev
2014-04-29 04:26 garrigue Resolution open => fixed
2014-04-29 04:26 garrigue Assigned To => garrigue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker