Ruby-trunk Marshal.dump bug

nagachika e$B$H?=$7$^$9!#e(B

Debian GNU/Linux e$B$Ge(B 1.9(trunk)
e$B$G0J2<$N%9%/%j%W%H$,4|BTDL$j$KF0$-$^$;$s!#e(B

$ cat test.rb
t = Time.now
p Marshal.load(Marshal.dump([t, t]))
$ ./ruby-trunk test.rb
[2008-03-28 09:44:03 +0900, “7P”]

[email protected]$K$Oe(B Time e$B$K8B$i$:!"e(B_dump
e$B$,JV$9J8;zNs$K%$%s%9%?%s%9JQ?t$,e(B
e$BDI2C$5$l$F$$$k$h$&$J>l9g$K$*$+$7$/$J$k$h$&$G$9!#e(B
Time e$B$Oe(B nsec
[email protected]:EY$N>pJs$r%$%s%9%?%s%9JQ?t$KF~$l$F$$$^$7$?!#e(B

e$B0J2<$O%Q%C%A$G$9!#$48!F$$/[email protected]$5$$!#e(B

Index: marshal.c

— marshal.c (e$B%j%S%8%g%se(B 15844)
+++ marshal.c (e$B:n6H%3%T!<e(B)
@@ -574,8 +574,6 @@
else {
if (OBJ_TAINTED(obj)) arg->taint = Qtrue;

  •   st_add_direct(arg->data, obj, arg->data->num_entries);
    
  •    {
           st_data_t compat_data;
           rb_alloc_func_t allocator =
    

rb_get_alloc_func(RBASIC(obj)->klass);
@@ -592,6 +590,8 @@
if (rb_respond_to(obj, s_mdump)) {
VALUE v;

  •       st_add_direct(arg->data, obj, arg->data->num_entries);
    
  •       v = rb_funcall(obj, s_mdump, 0, 0);
          w_class(TYPE_USRMARSHAL, obj, arg, Qfalse);
          w_object(v, arg, limit);
    

@@ -618,9 +618,13 @@
else if (hasiv) {
w_ivar(obj, ivtbl, &c_arg);
}

  •       st_add_direct(arg->data, obj, arg->data->num_entries);
    
  •       return;
      }
    
  •   st_add_direct(arg->data, obj, arg->data->num_entries);
    
  •   switch (BUILTIN_TYPE(obj)) {
        case T_CLASS:
          if (FL_TEST(obj, FL_SINGLETON)) {

In article [email protected],
nagachika [email protected] writes:

e$B0J2<$O%Q%C%A$G$9!#$48!F$$/[email protected]$5$$!#e(B
e$B$=$N%Q%C%[email protected][email protected]$He(B test_marshal.rb e$B$Ge(B SEGV
e$B$9$k$N$G!"$b$&$9e(B
[email protected]$7$FF~$l$^$7$?!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs