From 531f775fd4ed171a1f297e1aa00940ce9f2a457b Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 19 Mar 2015 12:26:49 +0000 Subject: [PATCH] * gc.c (rb_copy_wb_protected_attribute): demote `dest' object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ gc.c | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8b2edbf2aa..01f9280364 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Mar 19 21:25:25 2015 Koichi Sasada + + * gc.c (rb_copy_wb_protected_attribute): demote `dest' object. + Thu Mar 19 16:18:00 2015 Koichi Sasada * gc.c, internal.h: export rb_gc_verify_internal_consistency(). diff --git a/gc.c b/gc.c index 42525695e9..2a191ae90e 100644 --- a/gc.c +++ b/gc.c @@ -5734,13 +5734,18 @@ rb_copy_wb_protected_attribute(VALUE dest, VALUE obj) #if USE_RGENGC rb_objspace_t *objspace = &rb_objspace; + if (RGENGC_CHECK_MODE > 0 && RVALUE_WB_UNPROTECTED(dest)) { + rb_bug("rb_copy_wb_protected_attribute: dest should not be WB unprotected - %s", + obj_info(dest)); + } + if (RVALUE_WB_UNPROTECTED(obj)) { if (!RVALUE_OLD_P(dest)) { MARK_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS(dest), dest); RVALUE_AGE_RESET_RAW(dest); } else { - RVALUE_DEMOTE(objspace, obj); + RVALUE_DEMOTE(objspace, dest); } }