diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2016-03-02 00:11:22 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2016-03-02 00:11:22 +0300 |
commit | c20dc069cd2e575a1c9d1b3a932a513a159bd4c7 (patch) | |
tree | dbf84cf205122eb5873ed5d3a35924961fe4de8d /mallocx.c | |
parent | 3fbc3a79f3980a402613b81ef41676162b4d4781 (diff) |
Fix 'statement unreachable' compiler warning in memalign
* mallocx.c (GC_memalign): Do not handle case of
offset >= VALID_OFFSET_SZ; add assertion for offset; add static
assertion for VALID_OFFSET_SZ value.
Diffstat (limited to 'mallocx.c')
-rw-r--r-- | mallocx.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -485,7 +485,8 @@ GC_API GC_ATTR_MALLOC void * GC_CALL GC_memalign(size_t align, size_t lb) if (offset != 0) { offset = align - offset; if (!GC_all_interior_pointers) { - if (offset >= VALID_OFFSET_SZ) return GC_malloc(HBLKSIZE); + GC_STATIC_ASSERT(VALID_OFFSET_SZ <= HBLKSIZE); + GC_ASSERT(offset < VALID_OFFSET_SZ); GC_register_displacement(offset); } } |