Project

General

Profile

Actions

Bug #19833

closed

Superclass of BasicObject is broken.

Added by ksss (Yuki Kurihara) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.3.0dev (2023-08-08T00:21:45Z master 69292676a2) [arm64-darwin22]
[ruby-core:114356]

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.

https://github.com/ksss/orthoses/blob/341019c78ba625bc5d36c0f359c7d88621990f78/lib/orthoses/lazy_trace_point.rb#L35-L48

Actions

Also available in: Atom PDF

Like0
Like0Like0Like1Like0