diff options
author | Yinan Zhang <zyn8950@gmail.com> | 2019-05-15 14:50:10 (GMT) |
---|---|---|
committer | Qi Wang <interwq@gmail.com> | 2019-05-15 16:42:52 (GMT) |
commit | 13e88ae9700416b43bf88c596ea15c85bdb9f9e7 (patch) | |
tree | abf2f536716c45b3a21556b80bb94551fc8d6a5d | |
parent | 259b15dec5bff8b67b331b63703aa8511c759077 (diff) | |
download | jemalloc-13e88ae9700416b43bf88c596ea15c85bdb9f9e7.zip jemalloc-13e88ae9700416b43bf88c596ea15c85bdb9f9e7.tar.gz jemalloc-13e88ae9700416b43bf88c596ea15c85bdb9f9e7.tar.bz2 |
Fix assert in free fastpath
rtree_szind_slab_read_fast() may have not initialized
alloc_ctx.szind, unless after confirming the return is true.
-rw-r--r-- | src/jemalloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/jemalloc.c b/src/jemalloc.c index 04ebe51..ec6b400 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -2744,12 +2744,12 @@ bool free_fastpath(void *ptr, size_t size, bool size_hint) { bool res = rtree_szind_slab_read_fast(tsd_tsdn(tsd), &extents_rtree, rtree_ctx, (uintptr_t)ptr, &alloc_ctx.szind, &alloc_ctx.slab); - assert(alloc_ctx.szind != SC_NSIZES); /* Note: profiled objects will have alloc_ctx.slab set */ if (!res || !alloc_ctx.slab) { return false; } + assert(alloc_ctx.szind != SC_NSIZES); } else { /* * Check for both sizes that are too large, and for sampled objects. |