summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-09 23:48:17 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-09 23:48:17 +0000
commitd099eabbb7c0d493dbf6c665aceaf4738fc68d0e (patch)
tree518fa7529987a8318820fa006c447820100b7674 /compile.c
parente553d94f01ab5c101c26627132ed12e30a00e8f7 (diff)
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
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c2
1 files changed, 2 insertions, 0 deletions
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;
}