Project

General

Profile

Actions

Backport #5247

closed

Marshal.load didn't call correct initialize method of subclasses of a struct

Added by godfat (Lin Jen-Shin) over 13 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
[ruby-core:39165]

Description

It's ok in 1.9:

ruby -ve 'class C<Struct.new(:a);def initialize;end;end;p Marshal.load(Marshal.dump(C.new))'
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
#

But wrong in 1.8:

ruby-1.8 -ve 'class C<Struct.new(:a);def initialize;end;end;p Marshal.load(Marshal.dump(C.new))'
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
-e:1:in initialize': wrong number of arguments (1 for 0) (ArgumentError) from -e:1:in load'
from -e:1

Actions #1

Updated by jeremyevans0 (Jeremy Evans) over 5 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby 1.8 to Backport187
  • Status changed from Open to Closed
  • Target version deleted (Ruby 1.8.7)
  • ruby -v deleted (ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux])
Actions

Also available in: Atom PDF

Like0
Like0