Actions
Bug #19833
closedSuperclass of BasicObject is broken.
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.3.0dev (2023-08-08T00:21:45Z master 69292676a2) [arm64-darwin22]
Description
I encountered a phenomenon where a non-class object appeared in the superclass of BasicObject.
The minimum reproduction code is below.
module Mod
end
BasicObject.include Mod
# or BasicObject.prepend Mod
p BasicObject.superclass
#=> 2431129 or false
I think it is a practical problem because I found it by running code that monitors singleton_method_added
as follows.
Updated by znz (Kazuhiro NISHIYAMA) about 1 year ago
I can reproduce since 3.2.
$ docker run --platform linux/amd64 --rm -it ghcr.io/ruby/all-ruby env LANG=C.UTF-8 ALL_RUBY_SINCE=ruby-1.9 ./all-ruby -e 'class BasicObject; include ::Module.new; p superclass; end'
ruby-1.9.0-0 nil
...
ruby-3.2.0-preview1 nil
ruby-3.2.0-preview2 16
...
ruby-3.3.0-preview1 16
Updated by nobu (Nobuyoshi Nakada) about 1 year ago
- Backport changed from 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN to 3.0: DONTNEED, 3.1: DONTNEED, 3.2: REQUIRED
Updated by nobu (Nobuyoshi Nakada) about 1 year ago
- Status changed from Open to Closed
Applied in changeset git|72d1a790cfe0e4a457db98c587f1acaa5e39f001.
[Bug #19833] Fix index underflow at superclasses of BasicObject
Updated by nagachika (Tomoyuki Chikanaga) about 1 year ago
- Backport changed from 3.0: DONTNEED, 3.1: DONTNEED, 3.2: REQUIRED to 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONE
ruby_3_2 b11f238a811513b31c4f65c822370ac470f438dc merged revision(s) 72d1a790cfe0e4a457db98c587f1acaa5e39f001.
Actions
Like0
Like0Like0Like1Like0