diff --git a/ChangeLog b/ChangeLog index 2887de5bcb..c7b66e47c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Oct 7 16:42:28 2009 Nobuyoshi Nakada + + * marshal.c (mark_dump_arg, mark_load_arg): ignore already cleaned + data. [ruby-core:25969] + + * marshal.c (clear_dump_arg, clear_load_arg): clear freed fields. + Wed Oct 7 16:06:30 2009 Nobuyoshi Nakada * include/ruby/ruby.h (rb_long2int): evalates the argument only diff --git a/marshal.c b/marshal.c index 8424639287..58128ef0d5 100644 --- a/marshal.c +++ b/marshal.c @@ -162,7 +162,7 @@ static void mark_dump_arg(void *ptr) { struct dump_arg *p = ptr; - if (!ptr) + if (!p->symbols) return; rb_mark_set(p->data); rb_mark_hash(p->compat_tbl); @@ -850,7 +850,9 @@ clear_dump_arg(struct dump_arg *arg) st_free_table(arg->symbols); arg->symbols = 0; st_free_table(arg->data); + arg->data = 0; st_free_table(arg->compat_tbl); + arg->compat_tbl = 0; if (arg->encodings) { st_free_table(arg->encodings); arg->encodings = 0; @@ -974,7 +976,7 @@ static void mark_load_arg(void *ptr) { struct load_arg *p = ptr; - if (!ptr) + if (!p->symbols) return; rb_mark_tbl(p->data); rb_mark_hash(p->compat_tbl); @@ -1714,7 +1716,9 @@ clear_load_arg(struct load_arg *arg) st_free_table(arg->symbols); arg->symbols = 0; st_free_table(arg->data); + arg->data = 0; st_free_table(arg->compat_tbl); + arg->compat_tbl = 0; } /*