mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
merge revision(s) 53658: [Backport #12018]
* compile.c (iseq_peephole_optimize): don't apply tailcall optimization to send/invokesuper instructions with blockiseq. This is a follow-up to the changes in r51903; blockiseq is now the third operand of send/invokesuper instructions. [ruby-core:73413] [Bug #12018] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@54401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a61019eee3
commit
6af6154b41
4 changed files with 31 additions and 3 deletions
|
@ -275,6 +275,22 @@ class TestRubyOptimization < Test::Unit::TestCase
|
|||
assert_equal(123, delay { 123 }.call, bug6901)
|
||||
end
|
||||
|
||||
def just_yield
|
||||
yield
|
||||
end
|
||||
|
||||
def test_tailcall_inhibited_by_block
|
||||
assert_separately([], <<~'end;')
|
||||
def just_yield
|
||||
yield
|
||||
end
|
||||
iseq = RubyVM::InstructionSequence
|
||||
result = iseq.compile("just_yield {:ok}", __FILE__, __FILE__, __LINE__,
|
||||
tailcall_optimization: true).eval
|
||||
assert_equal(:ok, result)
|
||||
end;
|
||||
end
|
||||
|
||||
class Bug10557
|
||||
def [](_)
|
||||
block_given?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue