Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Truffle] zsuper bug with blocks #3106

Closed
nirvdrum opened this issue Jul 6, 2015 · 1 comment
Closed

[Truffle] zsuper bug with blocks #3106

nirvdrum opened this issue Jul 6, 2015 · 1 comment
Milestone

Comments

@nirvdrum
Copy link
Contributor

nirvdrum commented Jul 6, 2015

JRuby+Truffle does not properly pass arguments to a zsuper call made within a block. Instead of looking at the method argument list, it looks at the values yielded to the block.

Example:

class Base
  def visit(o)
    puts o
  end
end

class Sub < Base
  def with_node
    yield :wrong
  end

  def visit(o)
    with_node do |x|
      super
    end
  end
end

Sub.new.visit :correct

MRI 2.2.2:

> ruby -v zsuper.rb 
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
correct

JRuby+Truffle 9K:

> jt run -v zsuper.rb 
$ /home/nirvdrum/dev/workspaces/jruby/bin/jruby -X+T -v zsuper.rb
jruby 9.0.0.0-SNAPSHOT (2.2.2) 2015-07-06 dfdfb54 Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [linux-amd64]
wrong
nirvdrum added a commit that referenced this issue Jul 8, 2015
This fixes one very specific case of #3106: zsuper bug with blocks.
@eregon
Copy link
Member

eregon commented Jul 21, 2015

Can't we use the parent chain to get outside the block in the translator?

eregon added a commit to eregon/jruby that referenced this issue Jul 22, 2015
* So finding the right frame and slot is done by the findLocalVarNode helper.
* Clarify the strange case of zsuper without a surrounding method.
* Fixes jruby#3106.
@eregon eregon closed this as completed in 4a80f53 Jul 27, 2015
@enebo enebo modified the milestones: JRuby 9.0.1.0, truffe Aug 20, 2015
@chrisseaton chrisseaton modified the milestones: truffe, truffle-dev Dec 19, 2015
@enebo enebo added this to the Non-Release milestone Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants