diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-16 10:21:23 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-16 10:21:23 +0000 |
commit | 7c3b57b5d15e3a9a1a82523478f1b4f7035d405d (patch) | |
tree | 7750c86ba090665963adb024be13d3a32a5488eb /complex.c | |
parent | 73c8f0238448cfb401b1d2e7afec44763defd833 (diff) |
* complex.c (nucomp_marshal_{dump,load}): preserve instance
variables.
* rational.c (nurat_marshal_{dump,load}): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'complex.c')
-rw-r--r-- | complex.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -937,8 +937,12 @@ nucomp_inspect(VALUE self) static VALUE nucomp_marshal_dump(VALUE self) { + VALUE a; get_dat1(self); - return rb_assoc_new(dat->real, dat->image); + + a = rb_assoc_new(dat->real, dat->image); + rb_copy_generic_ivar(a, self); + return a; } static VALUE @@ -947,6 +951,7 @@ nucomp_marshal_load(VALUE self, VALUE a) get_dat1(self); dat->real = RARRAY_PTR(a)[0]; dat->image = RARRAY_PTR(a)[1]; + rb_copy_generic_ivar(self, a); return self; } |