Skip to content

Commit

Permalink
avoid segfault by zeroing out type tag
Browse files Browse the repository at this point in the history
  • Loading branch information
vilterp committed Jan 18, 2022
1 parent a75fe00 commit 4c4aaa7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4c4aaa7

Please sign in to comment.