From: k@... Date: 2016-01-25T12:33:39+00:00 Subject: [ruby-core:73413] [Ruby trunk - Bug #12018] [Open] Tail call optimization is incorrectly applied in Ruby 2.3.0 Issue #12018 has been reported by Kazuki Yamaguchi. ---------------------------------------- Bug #12018: Tail call optimization is incorrectly applied in Ruby 2.3.0 https://bugs.ruby-lang.org/issues/12018 * Author: Kazuki Yamaguchi * Status: Open * Priority: Normal * Assignee: * ruby -v: ruby 2.4.0dev (2016-01-25 trunk 53652) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- 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: ~~~ruby RubyVM::InstructionSequence.compile_option = { tailcall_optimization: true } def just_yield yield end eval "just_yield { }" ~~~ I attached a patch to fix it. ---Files-------------------------------- 0001-compile.c-fix-tailcall-optimization.patch (1.12 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: