fix_to_unprotected_FL_MARK.patch

Narihiro Nakamura, 12/03/2013 08:13 PM

Download (1.2 KB)

View differences:

ChangeLog
1
Tue Dec  3 18:36:42 2013  Narihiro Nakamura  <authornari@gmail.com>
2

  
3
	* object.c (rb_obj_clone): protect FL_MARK of a dest object. A lazy
4
	  sweeper free up a dest object if a marker is invoked immediately
5
	  following allocate a dest object in rb_obj_alloc().
6

  
1 7
Fri Nov 22 12:44:56 2013  Nobuyoshi Nakada  <nobu@ruby-lang.org>
2 8

  
3 9
	* util.c (ruby_strtod): ignore too long fraction part, which does not
object.c
285 285
    }
286 286
    clone = rb_obj_alloc(rb_obj_class(obj));
287 287
    RBASIC(clone)->klass = rb_singleton_class_clone(obj);
288
    RBASIC(clone)->flags = (RBASIC(obj)->flags | FL_TEST(clone, FL_TAINT) | FL_TEST(clone, FL_UNTRUSTED)) & ~(FL_FREEZE|FL_FINALIZE|FL_MARK);
288
    RBASIC(clone)->flags = (RBASIC(obj)->flags | FL_TEST(clone, FL_TAINT) | FL_TEST(clone, FL_UNTRUSTED)) & ~(FL_FREEZE|FL_FINALIZE|FL_MARK) | (RBASIC(clone)->flags&FL_MARK);
289 289
    init_copy(clone, obj);
290 290
    rb_funcall(clone, id_init_clone, 1, obj);
291 291
    RBASIC(clone)->flags |= RBASIC(obj)->flags & FL_FREEZE;