From: shibata.hiroshi@... Date: 2014-01-30T06:16:49+00:00 Subject: [ruby-core:60281] [ruby-trunk - Bug #7995] RubyVM::InstructionSequence to_a not working for blocks Issue #7995 has been updated by Hiroshi SHIBATA. Target version changed from 2.1.0 to current: 2.2.0 ---------------------------------------- Bug #7995: RubyVM::InstructionSequence to_a not working for blocks https://bugs.ruby-lang.org/issues/7995#change-44763 * Author: Michael Meltner * Status: Assigned * Priority: Normal * Assignee: Koichi Sasada * Category: YARV * Target version: current: 2.2.0 * ruby -v: - * Backport: ---------------------------------------- Hello, I try to convert this code into an array via RubyVM::InstructionSequence: ----- def test yield end test do puts "hi there" end ----- then read it back via "iseq_s_load". This causes an error that there is no block defined: :in `test': no block given (yield) (LocalJumpError) from :in `' I assume there is a bug in iseq.c, line 1778: rb_hash_aset(e, ID2SYM(rb_intern("blockptr")), ci->blockiseq ? seq_data_to_ary(ci->blockiseq) : Qnil); as the corresponding line in compile.c is this: VALUE vblock = rb_hash_aref(op, ID2SYM(rb_intern("block"))); so is the symbol name mixed up between "block" and "blockptr" ? - Michael -- http://bugs.ruby-lang.org/