diff options
author | Eric Mueller <eric.mueller1024@gmail.com> | 2023-04-17 18:59:25 -0700 |
---|---|---|
committer | Qi Wang <interwq@gmail.com> | 2023-04-17 20:57:48 -0700 |
commit | 521970fb2e5278b7b92061933cbacdbb9478998a (patch) | |
tree | 06fa089fa7341e09f494198ac6cc548550755b32 | |
parent | 5f64ad60cdd2359249c863c2a01f8555672d7c35 (diff) | |
download | jemalloc-521970fb2e5278b7b92061933cbacdbb9478998a.tar.gz |
Check for equality instead of assigning in asserts in hpa_from_pai.
It appears like a simple typo means we're unconditionally overwriting
some fields in hpa_from_pai when asserts are enabled. From hpa_shard_init,
it looks like these fields have these values anyway, so this shouldn't
cause bugs, but if something is wrong it seems better to have these
asserts in place.
See issue #2412.
-rw-r--r-- | src/hpa.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -703,10 +703,10 @@ hpa_alloc_batch_psset(tsdn_t *tsdn, hpa_shard_t *shard, size_t size, static hpa_shard_t * hpa_from_pai(pai_t *self) { - assert(self->alloc = &hpa_alloc); - assert(self->expand = &hpa_expand); - assert(self->shrink = &hpa_shrink); - assert(self->dalloc = &hpa_dalloc); + assert(self->alloc == &hpa_alloc); + assert(self->expand == &hpa_expand); + assert(self->shrink == &hpa_shrink); + assert(self->dalloc == &hpa_dalloc); return (hpa_shard_t *)self; } |