diff --git a/gc.c b/gc.c index e47a4adb1f..f2599adbde 100644 --- a/gc.c +++ b/gc.c @@ -8920,8 +8920,10 @@ rb_gc_writebarrier(VALUE a, VALUE b) { rb_objspace_t *objspace = &rb_objspace; - if (SPECIAL_CONST_P(a)) rb_bug("rb_gc_writebarrier: a is special const: %"PRIxVALUE, a); - if (SPECIAL_CONST_P(b)) rb_bug("rb_gc_writebarrier: b is special const: %"PRIxVALUE, b); + if (RGENGC_CHECK_MODE) { + if (SPECIAL_CONST_P(a)) rb_bug("rb_gc_writebarrier: a is special const: %"PRIxVALUE, a); + if (SPECIAL_CONST_P(b)) rb_bug("rb_gc_writebarrier: b is special const: %"PRIxVALUE, b); + } retry: if (!is_incremental_marking(objspace)) {