Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004821OCaml~DO NOT USE (was: OCaml general)public2009-06-12 14:142009-06-12 14:43
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version3.11.1+dev 
Summary0004821: Bad compilation of classes yields segfault
DescriptionConsider this piece of code:
class c = object(this)
  method m = ignore (this :> < m: unit; m: unit >)

let () = (new c) # m

The call to the method yields a segfault (or something similar).

The code generator produces a call to CamlinternalOo.make_class with an array of method being [| "m"; "m" |]. The explicit coercion should probably be rejected (and it is indeed rejected if we use an immediate object rather than a class). Or maybe the type expression (with a duplicated method name) itself should be rejected?
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
frisch (developer)
2009-06-12 14:19

The problem is probably in the type checker. The signature inferred for the class is:

class c : object method m : unit method m : unit end
garrigue (manager)
2009-06-12 14:43

Fixed in CVS branch 3.11: there was no check at all that the same method name was not used twice!

Unfortunately, it looks like this is a few hours late for makinf it into 3.11.1.

- Issue History
Date Modified Username Field Change
2009-06-12 14:14 frisch New Issue
2009-06-12 14:19 frisch Note Added: 0004992
2009-06-12 14:43 garrigue Note Added: 0004993
2009-06-12 14:43 garrigue Status new => closed
2009-06-12 14:43 garrigue Resolution open => fixed
2009-06-12 14:43 garrigue Fixed in Version => 3.11.1+dev
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker