Project

General

Profile

Actions

Bug #12018

closed

Tail call optimization is incorrectly applied in Ruby 2.3.0

Added by rhenium (Kazuki Yamaguchi) about 8 years ago. Updated about 8 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.4.0dev (2016-01-25 trunk 53652) [x86_64-linux]
[ruby-core:73413]

Description

r51903 changed the operand order of send/invokesuper instructions, but the code applying tail call optimization still looks at the second operand, which is now CALL_CACHE.
The following code causes a segmentation fault:

RubyVM::InstructionSequence.compile_option = { tailcall_optimization: true }

def just_yield
  yield
end

eval "just_yield { }"

I attached a patch to fix it.


Files

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0