Fix pointer comparision with undefined behavior.

This didn't cause bad code generation in the one case spot-checked (gcc
4.8.1), but had the potential to to so.  This bug was introduced by
594c759f37 (Optimize
arena_prof_tctx_set().).
This commit is contained in:
Jason Evans 2015-09-04 10:31:41 -07:00
parent 594c759f37
commit b4330b02a8

View File

@ -1105,8 +1105,8 @@ arena_prof_tctx_set(const void *ptr, size_t usize, prof_tctx_t *tctx)
assert(arena_mapbits_allocated_get(chunk, pageind) != 0); assert(arena_mapbits_allocated_get(chunk, pageind) != 0);
if (unlikely(usize > SMALL_MAXCLASS || tctx > if (unlikely(usize > SMALL_MAXCLASS || (uintptr_t)tctx >
(prof_tctx_t *)(uintptr_t)1U)) { (uintptr_t)1U)) {
arena_chunk_map_misc_t *elm; arena_chunk_map_misc_t *elm;
assert(arena_mapbits_large_get(chunk, pageind) != 0); assert(arena_mapbits_large_get(chunk, pageind) != 0);