[#24105] [Bug #1711] Marshal Failing to Round-Trip Certain Recurisve Data Structures — Run Paint Run Run <redmine@...>

Bug #1711: Marshal Failing to Round-Trip Certain Recurisve Data Structures

9 messages 2009/07/01

[#24116] [Bug #1715] Numeric#arg for NaN is Inconsistent Across Versions — Run Paint Run Run <redmine@...>

Bug #1715: Numeric#arg for NaN is Inconsistent Across Versions

10 messages 2009/07/02

[#24240] [Bug #1755] IO#reopen Doesn't Fully Associate with Given Stream on 1.9; Ignores pos on 1.8 — Run Paint Run Run <redmine@...>

Bug #1755: IO#reopen Doesn't Fully Associate with Given Stream on 1.9; Ignores pos on 1.8

8 messages 2009/07/09

[#24321] [Bug #1773] Gem path doesn't honor user gem? — Lin Jen-Shin <redmine@...>

Bug #1773: Gem path doesn't honor user gem?

12 messages 2009/07/14

[#24390] [Feature #1784] More encoding (Big5 series) support? — Lin Jen-Shin <redmine@...>

Feature #1784: More encoding (Big5 series) support?

12 messages 2009/07/16

[#24467] Re: [ruby-cvs:31226] Ruby:r24008 (ruby_1_8_6): Removed private on to_date and to_datetime. — Urabe Shyouhei <shyouhei@...>

Hello.

10 messages 2009/07/21

[#24472] [Feature #1800] rubygems can replace system executable files — Kazuhiro NISHIYAMA <redmine@...>

Feature #1800: rubygems can replace system executable files

13 messages 2009/07/21

[#24530] [Feature #1811] Default BasicSocket.do_not_reverse_lookup to true — Roger Pack <redmine@...>

Feature #1811: Default BasicSocket.do_not_reverse_lookup to true

9 messages 2009/07/23

[#24624] [Bug #1844] Immediates Should Not Respond to :dup — Run Paint Run Run <redmine@...>

Bug #1844: Immediates Should Not Respond to :dup

15 messages 2009/07/30

[ruby-core:24280] Problem with ruby-1.9.1-p129 (putstring opcode)

From: Mathijs Kwik <bluescreen303@...>
Date: 2009-07-12 01:10:50 UTC
List: ruby-core #24280
Hi,

I'm trying to use RubyVM::InstructionSequence to play around with bytecode.
To do something useful with it, I want to convert a sequence to an array.
There is a to_a method on instructionsequences, which works great.

After some playing with it, I noticed some code could not get translated.
I tracked the problem down and found it's related to using strings.
As long as I don't use any strings in scripts, everything works fine.
Using a string however triggers a strange problem.

I tried some different scripts and found that the problem lies in the
'putstring' opcode.

puts RubyVM::InstructionSequence.new("puts 'Hello, world!'").disasm
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace            1                                               (   1)
0002 putnil
0003 putstring        "Hello, world!"
0005 send             :puts, 1, nil, 8, <ic>
0011 leave
=> nil

Looks like the sequence is ok, but when converting it to an array, I get this:

puts RubyVM::InstructionSequence.new("puts 'Hello, world!'").to_a
YARVInstructionSequence/SimpleDataFormat
1
1
1
{:arg_size=>0, :local_size=>1, :stack_max=>2}
<compiled>
<compiled>
top
0
1
trace
1
putnil
putstring
NotImplementedError: method `respond_to?' called on terminated object
(0x000000016e45f0)
	from (irb):2:in `puts'
	from (irb):2:in `puts'
	from (irb):2
	from /opt/ruby-1.9/bin/irb:12:in `<main>'

I'm on ubuntu 9.04 64bit
I didn't use any special CFLAGS or options for ./configure.

Can anyone confirm this?
Is there a solution/workaround for this problem?

Thanks,
Mathijs

In This Thread

Prev Next