summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-01 22:52:35 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-01 22:52:35 +0000
commit1286674bb9855d69f3448fb76c2721c5ac38b84c (patch)
tree7843fbcb9e096070fd6417f6bf997e439fb99d7e /iseq.c
parent990df873029a632c06dee9de9768bda8400fe922 (diff)
unpoison / poison objects while walking the heap
This fixes some ASAN errors git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/iseq.c b/iseq.c
index 864e92645c..afe03777fc 100644
--- a/iseq.c
+++ b/iseq.c
@@ -1011,10 +1011,17 @@ remove_coverage_i(void *vstart, void *vend, size_t stride, void *data)
{
VALUE v = (VALUE)vstart;
for (; v != (VALUE)vend; v += stride) {
+ void *ptr = poisoned_object_p(v);
+ unpoison_object(v, false);
+
if (rb_obj_is_iseq(v)) {
rb_iseq_t *iseq = (rb_iseq_t *)v;
ISEQ_COVERAGE_SET(iseq, Qnil);
}
+
+ if (ptr) {
+ poison_object(v);
+ }
}
return 0;
}
@@ -3156,9 +3163,16 @@ trace_set_i(void *vstart, void *vend, size_t stride, void *data)
VALUE v = (VALUE)vstart;
for (; v != (VALUE)vend; v += stride) {
+ void *ptr = poisoned_object_p(v);
+ unpoison_object(v, false);
+
if (rb_obj_is_iseq(v)) {
rb_iseq_trace_set(rb_iseq_check((rb_iseq_t *)v), turnon_events);
}
+
+ if (ptr) {
+ poison_object(v);
+ }
}
return 0;
}