Project

General

Profile

Actions

Bug #15913

closed

Segmentation fault in using RubyVM::InstructionSequence#to_binary.

Added by Anonymous over 5 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin18]
[ruby-dev:50793]

Description

Occur Segmentation fault when the ruby code is class methods with hash argument in if false statement in iteration methods into RubyVM::InstructionSequence.compile.

# 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
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0