[macruby-changes] [4358] MacRuby/trunk/complex.c

source_changes at macosforge.org source_changes at macosforge.org
Tue Jul 13 15:49:49 PDT 2010


Revision: 4358
          http://trac.macosforge.org/projects/ruby/changeset/4358
Author:   martinlagardette at apple.com
Date:     2010-07-13 15:49:49 -0700 (Tue, 13 Jul 2010)
Log Message:
-----------
Fix `#marshal_load` for non-array arguments

 - Fixes <rdar://problem/8164079>

Modified Paths:
--------------
    MacRuby/trunk/complex.c

Modified: MacRuby/trunk/complex.c
===================================================================
--- MacRuby/trunk/complex.c	2010-07-13 22:37:13 UTC (rev 4357)
+++ MacRuby/trunk/complex.c	2010-07-13 22:49:49 UTC (rev 4358)
@@ -1324,9 +1324,10 @@
 nucomp_marshal_load(VALUE self, SEL sel, VALUE a)
 {
     get_dat1(self);
-    GC_WB(&dat->real, RARRAY_AT(a, 0));
-    GC_WB(&dat->imag, RARRAY_AT(a, 1));
-    rb_copy_generic_ivar(self, a);
+    VALUE ary = rb_convert_type(a, T_ARRAY, "Array", "to_ary");
+    GC_WB(&dat->real, RARRAY_AT(ary, 0));
+    GC_WB(&dat->imag, RARRAY_AT(ary, 1));
+    rb_copy_generic_ivar(self, ary);
     return self;
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100713/20caf0fa/attachment-0001.html>


More information about the macruby-changes mailing list