Actions
Bug #2601
closedBasicObject.initialize should raise an error
Description
=begin
While having fun cloning BasicObject (see issue 2443), I found the amusing bug that :initialize could successfully be sent to BasicObject, creating all sorts of havoc.
$ rubydev -e "BasicObject.send :initialize; puts Object.ancestors" # => Loops indefinitely
$ rubydev -e "BasicObject.send :initialize, String; puts 42.upcase" # => Segmentation Fault
It was even possible to change the root of all Ruby classes without running into trouble:
$ rubydev -e '
SuperBasicObject = BasicObject.clone
BasicObject.send :initialize, SuperBasicObject
puts BasicObject.superclass
'
==> SuperBasicObject¶
I fixed it, although changes might be required depending on the outcome of issue #2443.
=end
Actions
Like0
Like0Like0