From: naruse@... Date: 2016-03-29T13:25:31+00:00 Subject: [ruby-core:74688] [Ruby trunk Bug#12018] Tail call optimization is incorrectly applied in Ruby 2.3.0 Issue #12018 has been updated by Yui NARUSE. Backport changed from 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONTNEED, 2.3: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONE ruby_2_3 r54401 merged revision(s) 53658. ---------------------------------------- Bug #12018: Tail call optimization is incorrectly applied in Ruby 2.3.0 https://bugs.ruby-lang.org/issues/12018#change-57818 * Author: Kazuki Yamaguchi * Status: Closed * Priority: Normal * Assignee: * ruby -v: ruby 2.4.0dev (2016-01-25 trunk 53652) [x86_64-linux] * Backport: 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONE ---------------------------------------- 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: