[ruby-dev:50796] [Ruby trunk Bug#15913] Segumentation fault in using RubyVM::InstructionSequence#to_binary.
From:
naritatakuya0000@...
Date:
2019-06-12 09:52:23 UTC
List:
ruby-dev #50796
Issue #15913 has been updated by binaryta (Takuya Narita).
a
----------------------------------------
Bug #15913: Segumentation fault in using RubyVM::InstructionSequence#to_binary.
https://bugs.ruby-lang.org/issues/15913#change-78474
* Author: binaryta (Takuya Narita)
* Status: Open
* 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/