Project

General

Profile

Actions

Bug #22712

closed

YJIT sometimes does not pass &block_argument properly with super

Bug #22712: YJIT sometimes does not pass &block_argument properly with super

Added by alanwu (Alan Wu) about 23 hours ago. Updated about 4 hours ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:127824]

Description

# --yjit-call-threshold=1
class A
  def foo(x) = block_given? ? :got_block : :no_block
end
class B < A
  def foo(x) = super(x, &nil)
end
b = B.new
arg = b
arg = 0 if ENV['MASK']
p(b.foo(arg) {}) # => :got_block, should be :no_block

The argument being an instance of B is important. YJIT's reading of the wrong slot for super's is-a check can easily mask this bug as invokesuper_defined_class_mismatch.

https://github.com/ruby/ruby/pull/20456

Actions

Also available in: PDF Atom