diff options
author | Qi Wang <interwq@gwu.edu> | 2017-12-22 19:22:16 (GMT) |
---|---|---|
committer | Qi Wang <interwq@gmail.com> | 2018-01-05 21:05:17 (GMT) |
commit | 41790f4fa475434ea84b8509b9a68e63d9a86f95 (patch) | |
tree | b3f20a970eae0a861480f02f1f5b9cd6e4ee7eb2 | |
parent | 91b247d311ce6837aa93d4315f5f7680abd8a11a (diff) | |
download | jemalloc-41790f4fa475434ea84b8509b9a68e63d9a86f95.zip jemalloc-41790f4fa475434ea84b8509b9a68e63d9a86f95.tar.gz jemalloc-41790f4fa475434ea84b8509b9a68e63d9a86f95.tar.bz2 |
Check tsdn_null before reading reentrancy level.
-rw-r--r-- | include/jemalloc/internal/jemalloc_internal_inlines_c.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/jemalloc/internal/jemalloc_internal_inlines_c.h b/include/jemalloc/internal/jemalloc_internal_inlines_c.h index 499ac1b..c829ac6 100644 --- a/include/jemalloc/internal/jemalloc_internal_inlines_c.h +++ b/include/jemalloc/internal/jemalloc_internal_inlines_c.h @@ -111,7 +111,8 @@ idalloctm(tsdn_t *tsdn, void *ptr, tcache_t *tcache, alloc_ctx_t *alloc_ctx, if (config_stats && is_internal) { arena_internal_sub(iaalloc(tsdn, ptr), isalloc(tsdn, ptr)); } - if (!is_internal && tsd_reentrancy_level_get(tsdn_tsd(tsdn)) != 0) { + if (!is_internal && !tsdn_null(tsdn) && + tsd_reentrancy_level_get(tsdn_tsd(tsdn)) != 0) { assert(tcache == NULL); } arena_dalloc(tsdn, ptr, tcache, alloc_ctx, slow_path); |