aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-25 13:19:45 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-25 13:19:45 +0000
commit1753fa891b9a1e02c8c4e2e490c40d2b465c1e64 (patch)
treed844d16e6f337254d83927ec61e063cf5307007d /gc.c
parent9185bee7fb1d09cd199e3cea2a5a12bd0e552037 (diff)
downloadruby-1753fa891b9a1e02c8c4e2e490c40d2b465c1e64.tar.gz
Make imemo_alloc writebarrier-unprotected
imemo_alloc provides a memory buffer whose contents are marked by GC. C code can access imemo_alloc buffer freely, so imemo_alloc must be considered writebarrier-unprotected. But T_IMEMO is writebarrier- protected by default, which caused a GC bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 086b6ad96e..6e32997b8e 100644
--- a/gc.c
+++ b/gc.c
@@ -8118,6 +8118,7 @@ rb_alloc_tmp_buffer_with_count(volatile VALUE *store, size_t size, size_t cnt)
void *ptr;
s = rb_imemo_new(imemo_alloc, 0, 0, 0, 0);
+ rb_gc_writebarrier_unprotect(s);
ptr = ruby_xmalloc0(size);
a = (rb_imemo_alloc_t*)s;
a->ptr = (VALUE*)ptr;