B
Brad Hilton
Hello,
The following code produces a segfault with ruby-1.8.4 from gentoo,
as well as with ruby-1.8 from cvs and 1.9 from cvs. There appears to
be an issue when super is called in the subclass and the parent class
has method_missing defined. Strangely, if super is called with
explicit arguments, no segfault occurs. Likewise, if the method
definition in the subclass is modified slightly (see below) the
segfault is avoided.
Thanks,
Brad
------------------------------------
class BaseClass
def method_missing(*args)
p args
end
end
class Article < BaseClass
# if this is defined as title=(arg) the segfault does not occur
def title=(*args)
super(args) # works
super(*args) # works
super # segfault...
end
end
a = Article.new
a.body = 'body'
a.title = 'foo'
-------------------------------
The following code produces a segfault with ruby-1.8.4 from gentoo,
as well as with ruby-1.8 from cvs and 1.9 from cvs. There appears to
be an issue when super is called in the subclass and the parent class
has method_missing defined. Strangely, if super is called with
explicit arguments, no segfault occurs. Likewise, if the method
definition in the subclass is modified slightly (see below) the
segfault is avoided.
Thanks,
Brad
------------------------------------
class BaseClass
def method_missing(*args)
p args
end
end
class Article < BaseClass
# if this is defined as title=(arg) the segfault does not occur
def title=(*args)
super(args) # works
super(*args) # works
super # segfault...
end
end
a = Article.new
a.body = 'body'
a.title = 'foo'
-------------------------------