From: naritatakuya0000@... Date: 2019-06-13T03:16:55+00:00 Subject: [ruby-dev:50800] [Ruby trunk Bug#15913] Segmentation fault in using RubyVM::InstructionSequence#to_binary. Issue #15913 has been updated by binaryta (Takuya Narita). I didn't know this problem already fixed. Thanks. ---------------------------------------- Bug #15913: Segmentation fault in using RubyVM::InstructionSequence#to_binary. https://bugs.ruby-lang.org/issues/15913#change-78504 * Author: binaryta (Takuya Narita) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin18] * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- Occur Segmentation fault when the ruby code is class methods with hash argument in if false statement in iteration methods into RubyVM::InstructionSequence.compile. ```ruby # good RubyVM::InstructionSequence.compile('puts "Hello, World"').to_binary RubyVM::InstructionSequence.compile('{}.each {|this| Hash.new({id: 1})}').to_binary # bad RubyVM::InstructionSequence.compile('{}.each {|this| if false; Hash.new({id: 1}); end }').to_binary RubyVM::InstructionSequence.compile('{}.map {|this| if false; Hash.new({id: 1}); end }').to_binary RubyVM::InstructionSequence.compile('{}.select {|this| if false; Hash.new({id: 1}); end }').to_binary RubyVM::InstructionSequence.compile('{}.each_with_index {|this, i| if false; Hash.new({id: 1}); end }').to_binary # ... and more iterator methods ``` -- https://bugs.ruby-lang.org/