disable assertion when MSAN is active

These assertions check if a newly allocated object (which is marked
as an uninitialized memory region in MSAN) is in fact a T_NONE.

Thus they intentionally read uninitialized memory regions, which do
not interface well with MSAN.  Just disalbe them.
This commit is contained in:
Urabe, Shyouhei 2019-04-23 17:55:15 +09:00
Родитель bdd1b300f8
Коммит 1f4204a762
1 изменённых файлов: 2 добавлений и 0 удалений

2
gc.c
Просмотреть файл

@ -1891,8 +1891,10 @@ gc_event_hook_body(rb_execution_context_t *ec, rb_objspace_t *objspace, const rb
static inline VALUE
newobj_init(VALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3, int wb_protected, rb_objspace_t *objspace, VALUE obj)
{
#if !__has_feature(memory_sanitizer)
assert(BUILTIN_TYPE(obj) == T_NONE);
assert((flags & FL_WB_PROTECTED) == 0);
#endif
/* OBJSETUP */
RBASIC(obj)->flags = flags;