Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Unity-Technologies/bdwgc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2016-03-02 00:11:22 +0300
committerIvan Maidanski <ivmai@mail.ru>2016-03-02 00:11:22 +0300
commitc20dc069cd2e575a1c9d1b3a932a513a159bd4c7 (patch)
treedbf84cf205122eb5873ed5d3a35924961fe4de8d /mallocx.c
parent3fbc3a79f3980a402613b81ef41676162b4d4781 (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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mallocx.c b/mallocx.c
index 75147486..f758bf8b 100644
--- a/mallocx.c
+++ b/mallocx.c
@@ -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);
}
}