summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorUrabe, Shyouhei <shyouhei@ruby-lang.org>2019-04-23 17:55:15 +0900
committerUrabe, Shyouhei <shyouhei@ruby-lang.org>2019-04-26 15:59:40 +0900
commit1f4204a762b2ddcc2f235b1a2b6a10071ef90d3b (patch)
tree21584b192ac5a93f81e5684384bdc0021651706e /gc.c
parentbdd1b300f8bf540c8f237cce50e42991f94101e3 (diff)
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.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c2
1 files changed, 2 insertions, 0 deletions
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;