Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004821OCamlOCaml generalpublic2009-06-12 14:142009-06-12 14:43
Reporterfrisch 
Assigned To 
PrioritynormalSeveritycrashReproducibilityalways
StatusclosedResolutionfixed 
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 >)
end

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
(0004992)
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
(0004993)
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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker