From 4c4aaa75fc3e04ea63b6aaab8d17760cfdf5b675 Mon Sep 17 00:00:00 2001 From: Pete Vilter Date: Mon, 17 Jan 2022 20:50:35 -0500 Subject: [PATCH] avoid segfault by zeroing out type tag --- src/gc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gc.c b/src/gc.c index ff91f89a6ca922..224400c23ba7a8 100644 --- a/src/gc.c +++ b/src/gc.c @@ -1201,6 +1201,9 @@ JL_DLLEXPORT jl_value_t *jl_gc_pool_alloc_outer(jl_ptls_t ptls, int pool_offset, int osize) { jl_value_t *val = jl_gc_pool_alloc(ptls, pool_offset, osize); + // zero out the type tag so it's not garbage + jl_set_typeof(val, 0); + maybe_record_alloc_to_profile(val, osize); return val; }