mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 20:44:20 +00:00
[ruby/mmtk] Check that a and b are valid objects in write barrier
https://github.com/ruby/mmtk/commit/350625ebb3
This commit is contained in:
parent
08f6b8673a
commit
1abb609d66
@ -963,6 +963,18 @@ rb_gc_impl_writebarrier(void *objspace_ptr, VALUE a, VALUE b)
|
||||
|
||||
if (SPECIAL_CONST_P(b)) return;
|
||||
|
||||
#ifdef MMTK_DEBUG
|
||||
if (!rb_gc_impl_pointer_to_heap_p(objspace_ptr, (void *)a)) {
|
||||
char buff[256];
|
||||
rb_bug("a: %s is not an object", rb_raw_obj_info(buff, 256, a));
|
||||
}
|
||||
|
||||
if (!rb_gc_impl_pointer_to_heap_p(objspace_ptr, (void *)b)) {
|
||||
char buff[256];
|
||||
rb_bug("b: %s is not an object", rb_raw_obj_info(buff, 256, b));
|
||||
}
|
||||
#endif
|
||||
|
||||
mmtk_object_reference_write_post(cache->mutator, (MMTk_ObjectReference)a);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user