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: 4435 Reporter: jm Status: closed (set by @garrigue on 2007-10-29T03:17:08Z) Resolution: fixed Priority: normal Severity: crash Version: 3.10+dev Fixed in version: 3.10+dev Category: ~DO NOT USE (was: OCaml general) Monitored by: jm
Bug description
Here 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 =
c#m;;
zsh: segmentation fault ocaml
The text was updated successfully, but these errors were encountered:
Fixed in branch release310 (bytecomp/transclass.ml, stdlib/camlinternalOO.ml)
Implicit instance variables should not be treated as normal instance variables.
Original bug ID: 4435
Reporter: jm
Status: closed (set by @garrigue on 2007-10-29T03:17:08Z)
Resolution: fixed
Priority: normal
Severity: crash
Version: 3.10+dev
Fixed in version: 3.10+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: jm
Bug description
Here 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 =
c#m;;
zsh: segmentation fault ocaml
The text was updated successfully, but these errors were encountered: