From fc035fe32147b8de4b07d80cf61f03995d3269ca Mon Sep 17 00:00:00 2001 From: tadf Date: Tue, 16 Sep 2008 10:21:23 +0000 Subject: * complex.c (nucomp_marshal_{dump,load}): preserve instance variables. * rational.c (nurat_marshal_{dump,load}): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- complex.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'complex.c') diff --git a/complex.c b/complex.c index 1739cc12b..0ed8a2c45 100644 --- a/complex.c +++ b/complex.c @@ -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; } -- cgit