Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another OO segfault #4561

Closed
vicuna opened this Issue Jun 4, 2008 · 1 comment

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

vicuna commented Jun 4, 2008

Original bug ID: 4561
Reporter: palomer
Status: closed (set by @garrigue on 2008-06-04T07:33:49Z)
Resolution: fixed
Priority: normal
Severity: crash
Version: 3.09.1
Fixed in version: 3.10.3+dev
Category: ~DO NOT USE (was: OCaml general)
Duplicate of: #4560

Bug description

Here's another piece of code (much more complicated) that segfaults:

class virtual bottle_environment =
object
method virtual gladiators : string list
method virtual bottles : bottle list
end
and virtual bottle =
object
method virtual action : (unit -> bottle_environment option)
end

type outer_space = {
foo : int list
}
let empty_outer_space =
{

foo = [];

}

class virtual expression =
object
method virtual get_silly_bottle : bottle
end
class virtual expression_skel =
object(self)
inherit expression
method bambam = empty_outer_space
method get_silly_bottle =
(object
inherit bottle
method action () =
Some (object
method gladiators =
print_endline "entering bottles";
ignore (self#bambam.foo);
["enter "]
method bottles =

	 []
     end)

end)
end

class virtual baggy_expression_skel =
object(self)
inherit expression_skel
method get_bottle_environment =
object
method gladiators = ([]:string list)
method bottles = [self#get_silly_bottle]
end
end

class virtual papa_expression_skel =
object(self)
method get_right_sibling_specific = print_endline "im being called, though I shouldn't" ; (None:expression option)
inherit expression
end

class papa_baggy_expression =
object(self)
inherit baggy_expression_skel
inherit papa_expression_skel
end

class top_baggy_expression =
object(self)
inherit baggy_expression_skel
end

let _ =
let body_expression = new top_baggy_expression in
let e = new papa_baggy_expression in
ignore ((body_expression#get_bottle_environment)#bottles);
let sugg = e#get_silly_bottle in
match sugg#action () with
| None -> ()
| Some y ->
ignore (y#gladiators)

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jun 4, 2008

Comment author: @garrigue

exactly the same problem as #4561, which is now closed.

@vicuna vicuna closed this Jun 4, 2008

@vicuna vicuna added the duplicate label Mar 14, 2019

@vicuna vicuna added the bug label Mar 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.