summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYinan Zhang <zyn8950@gmail.com>2019-05-15 14:50:10 (GMT)
committerQi Wang <interwq@gmail.com>2019-05-15 16:42:52 (GMT)
commit13e88ae9700416b43bf88c596ea15c85bdb9f9e7 (patch)
treeabf2f536716c45b3a21556b80bb94551fc8d6a5d
parent259b15dec5bff8b67b331b63703aa8511c759077 (diff)
downloadjemalloc-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.c2
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.