Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004435OCamlOCaml generalpublic2007-10-27 18:152007-10-29 04:17
Reporterjm 
Assigned To 
PrioritynormalSeveritycrashReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.10+dev 
Target VersionFixed in Version3.10+dev 
Summary0004435: The same name for an argument and a value of a class may cause a segfault.
DescriptionHere initializer uses the class value [v] (defined after)
instead of the argument value [v]. Which causes a trivial segfault:
% ocaml
        Objective Caml version 3.10.1+dev0 (2007-05-21)

# class c v = object initializer print_endline v val v = 42 end;;
class c : string -> object val v : int end
# new c "42";;
zsh: segmentation fault ocaml

Same thing for methods:
% ocaml
        Objective Caml version 3.10.1+dev0 (2007-05-21)

# class c v = object method m = print_endline v val v = 42 end;;
class c : string -> object val v : int method m : unit end
# let c = new c "42";;
val c : c = <obj>
# c#m;;
zsh: segmentation fault ocaml
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0004212)
garrigue (manager)
2007-10-29 04:17

Fixed in branch release310 (bytecomp/transclass.ml, stdlib/camlinternalOO.ml)
Implicit instance variables should not be treated as normal instance variables.

- Issue History
Date Modified Username Field Change
2007-10-27 18:15 jm New Issue
2007-10-29 04:17 garrigue Status new => closed
2007-10-29 04:17 garrigue Note Added: 0004212
2007-10-29 04:17 garrigue Resolution open => fixed
2007-10-29 04:17 garrigue Fixed in Version => 3.10+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker