From d099eabbb7c0d493dbf6c665aceaf4738fc68d0e Mon Sep 17 00:00:00 2001 From: tenderlove Date: Tue, 9 Apr 2019 23:48:17 +0000 Subject: Set a write barrier between iseq and mark objects ISeq pins references in the mark array during compile, so it manually marks references in the mark_ary. This was causing write barrier misses, so we need to add a write barrier when pushing on the mark array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- compile.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compile.c b/compile.c index 46b8217e7e..96aece6ecc 100644 --- a/compile.c +++ b/compile.c @@ -574,6 +574,7 @@ static int iseq_add_mark_object_compile_time(const rb_iseq_t *iseq, VALUE v) { if (!SPECIAL_CONST_P(v)) { + rb_gc_writebarrier(iseq, v); rb_ary_push(ISEQ_COMPILE_DATA(iseq)->mark_ary, v); } return COMPILE_OK; @@ -583,6 +584,7 @@ static inline VALUE freeze_literal(rb_iseq_t *iseq, VALUE lit) { lit = rb_fstring(lit); + rb_gc_writebarrier(iseq, lit); rb_ary_push(ISEQ_COMPILE_DATA(iseq)->mark_ary, lit); return lit; } -- cgit v1.2.3