From 1f4204a762b2ddcc2f235b1a2b6a10071ef90d3b Mon Sep 17 00:00:00 2001 From: "Urabe, Shyouhei" Date: Tue, 23 Apr 2019 17:55:15 +0900 Subject: [PATCH] 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. --- gc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gc.c b/gc.c index 82199bb47e..b4ad456b41 100644 --- a/gc.c +++ b/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;