diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-09 23:48:17 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-09 23:48:17 +0000 |
commit | d099eabbb7c0d493dbf6c665aceaf4738fc68d0e (patch) | |
tree | 518fa7529987a8318820fa006c447820100b7674 /compile.c | |
parent | e553d94f01ab5c101c26627132ed12e30a00e8f7 (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.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; } |