Project

General

Profile

Actions

Bug #22527

open

Implicit super with a reassigned keyword rest writes into the shared frozen empty hash

Bug #22527: Implicit super with a reassigned keyword rest writes into the shared frozen empty hash

Added by kddnewton (Kevin Newton) about 18 hours ago. Updated about 18 hours ago.

Status:
Open
Target version:
-
[ruby-core:127389]

Description

zsuper passes rest.dup as the left operand of the keyword merge. If the method reassigns its keyword-rest local, that value can be anything. Both compilers reach this through merge_bang_ptr, where dup is false, so it inserts into the shared frozen hash.

class A; def m(*a, **k) = k; end
class B < A
  def m(k: 1, **r)
    r = nil
    super
  end
end
p B.new.m

Under 4.0 this was a TypeError, now it is an assertion failure in ar_force_convert_table.

Actions

Also available in: PDF Atom