RubyVM::InstructionSequence to_a not working for blocks
I try to convert this code into an array via RubyVM::InstructionSequence:¶
puts "hi there"
then read it back via "iseq_s_load".
This causes an error that there is no block defined:
test': no block given (yield) (LocalJumpError) from <compiled>: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" ?
Updated by nagachika (Tomoyuki Chikanaga) over 9 years ago
- Tracker changed from Backport to Bug
- Project changed from Backport200 to Ruby master
- Status changed from Open to Assigned
- Assignee set to ko1 (Koichi Sasada)
Backport 200 is project for backport tickets. I'll move it to ruby-trunk.