Project

General

Profile

Bug #9455

Blocks do not round-trip properly through ISeq dump/load

Added by charliesome (Charlie Somerville) about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:60146]

Description

Blocks passed to methods do not round-trip properly when dumped with RubyVM::InstructionSequence#to_a and then loaded again with rb_iseq_load.

This is because iseq_data_to_ary in iseq.c stores serialized blocks under the :blockptr key (https://github.com/ruby/ruby/blob/trunk/iseq.c#L1813), but expects them to be stored in the :block key when loading them back up (https://github.com/ruby/ruby/blob/trunk/compile.c#L5811).

This affects trunk, 2.1.0 and 2.0.0.


Related issues

Has duplicate Ruby master - Bug #7995: RubyVM::InstructionSequence to_a not working for blocksClosed03/02/2013ko1 (Koichi Sasada)Actions

Also available in: Atom PDF