Project

General

Profile

Bug #7995

RubyVM::InstructionSequence to_a not working for blocks

Added by mmeltner (Michael Meltner) over 4 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
-
Backport:
[ruby-core:53077]

Description

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 <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" ?

  • Michael

Related issues

Is duplicate of Ruby trunk - Bug #9455: Blocks do not round-trip properly through ISeq dump/loadClosed2014-01-27

History

#1 Updated by nagachika (Tomoyuki Chikanaga) over 4 years ago

  • Tracker changed from Backport to Bug
  • Project changed from Backport200 to Ruby trunk
  • 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.

#2 [ruby-core:57488] Updated by ko1 (Koichi Sasada) about 4 years ago

  • Category set to YARV
  • Target version set to 2.1.0
  • ruby -v set to -

#3 [ruby-core:60281] Updated by hsbt (Hiroshi SHIBATA) almost 4 years ago

  • Target version changed from 2.1.0 to 2.2.0

#4 [ruby-core:67029] Updated by wanabe (_ wanabe) almost 3 years ago

  • Is duplicate of Bug #9455: Blocks do not round-trip properly through ISeq dump/load added

#5 [ruby-core:67031] Updated by wanabe (_ wanabe) almost 3 years ago

  • Status changed from Assigned to Closed

Fixed at r44720, #9455.

Also available in: Atom PDF