avoid unnecessary GNU pointer arithmetic extension

pull/69/head
Daniel Micay 2018-12-05 02:45:24 -05:00
parent 7f781af929
commit 7917966eca
1 changed files with 2 additions and 2 deletions

View File

@ -381,13 +381,13 @@ static void *slot_pointer(size_t size, void *slab, size_t slot) {
return (char *)slab + slot * size; return (char *)slab + slot * size;
} }
static void write_after_free_check(const void *p, size_t size) { static void write_after_free_check(const char *p, size_t size) {
if (!WRITE_AFTER_FREE_CHECK) { if (!WRITE_AFTER_FREE_CHECK) {
return; return;
} }
for (size_t i = 0; i < size; i += sizeof(u64)) { for (size_t i = 0; i < size; i += sizeof(u64)) {
if (*(const u64 *)(p + i)) { if (*(const u64 *)(const void *)(p + i)) {
fatal_error("detected write after free"); fatal_error("detected write after free");
} }
} }