Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Error in Rubinius::CompiledFile.unmarshal #1706

Closed
jeanlazarou opened this Issue · 0 comments

2 participants

@jeanlazarou

When trying to reload a compiled script it crashes on loading 'Hello world' string

Code example file hello.rb:

puts "Hello world!"

Loading the compiled file with a code like:

stream = File.open('hello.rbc')

cf = Rubinius::CompiledFile.load(stream)

cf.body

Generates next error:


An exception occurred running tmp.rb
    Unknown type '2' (RuntimeError)

Backtrace:
 Rubinius::CompiledFile::Marshal#unmarshal_data at /home/lab/.rvm/rubies
                                                   /rbx-2.0.0pre/runtime/18                                                                                                                               
                                                   /compiler                                                                                                                                              
                                                   /compiled_file.rbc:197  


Due to a missing discard #remove the \n in the when ?E branch (unmarshalling a string with encoding).

(in Rubinius 2.0, file lib/compiled_file.rb, line 171)

@jfirebaugh jfirebaugh closed this issue from a commit
@jfirebaugh jfirebaugh Fix CompiledFile unmarshalling
This Ruby unmarshaller is not currently exercised by normal code
loading: it uses marshal.cpp instead.

Fixes #1706.
a6fb7b6
@jfirebaugh jfirebaugh closed this in a6fb7b6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.