zsuper does not cope with n repeated _ well #4342

Closed
enebo opened this Issue Nov 28, 2016 · 0 comments

Projects

None yet

1 participant

@enebo
Member
enebo commented Nov 28, 2016

Given this script:

class A
  def foo(a, b, c)
    p a, b, c
  end
end

class B < A
  def foo(_, _, _)
    super
  end
end

B.new.foo(1, 2, 3)

we should print 1,2,3 but pre-fixed #4341 we would throw a 1 for 3 arity error and now we print out 3, 3, 3.

@enebo enebo added the ir label Nov 28, 2016
@enebo enebo added this to the JRuby 9.1.7.0 milestone Nov 28, 2016
@enebo enebo added a commit that closed this issue Nov 28, 2016
@enebo enebo Fixes #4342. zsuper does not cope with n repeated _ well.
Basically all recv_* instrs will now check to see if they are assigning
to _ or not.  On first occurrence of _ we will actually assign to it like
an ordinary lvar.  On any additional parameter which uses the name we will
assign it to a temporary variable.  If that scope happens to have a zsuper
then those additional occurrences are not dead.  If not they fall out as
we optimize.
a416abe
@enebo enebo closed this in a416abe Nov 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment