Actions
Bug #22562
openType confusion SEGV: Using `super`, `instance_exec`, and `bind_call`, it is possible to run Array#first on an instance of Integer
Bug #22562:
Type confusion SEGV: Using `super`, `instance_exec`, and `bind_call`, it is possible to run Array#first on an instance of Integer
Description
The following crashes 3.3.0 through current trunk (caf4f279d1):
module M
# fixnum: (0x6f56<<1)+1 = 0xdead
def first = 0x6f56.instance_exec { super }
end
M.instance_method(:first).bind_call([])
# <internal:array>:132: [BUG] Segmentation fault at 0x000000000000dead
Generally, the body of methods don't type-check self, relying on method dispatch to uphold the is-a relationship between self and the class/module defining the method. This funky use of super breaks that invariant.
Actions