diff --git a/src/opt/mm_buddy.c b/src/opt/mm_buddy.c index d5d7478c..62f5dcc7 100644 --- a/src/opt/mm_buddy.c +++ b/src/opt/mm_buddy.c @@ -63,7 +63,10 @@ void tailVerifyAlloc(void* ptr, u64 filled, i64 logAlloc, u8 type) { if (type==t_talloc) ((u64*)((u8*)ptr + end - 8))[0] = filled-8; // -8 because TALLOCP does a +8 } void verifyEnd(void* ptr, u64 sz, u64 start, u64 end) { - if (end+64>sz) { printf("Bad used range: "N64u".."N64u", allocation size "N64u"\n", start, end, sz); __builtin_trap(); } + if (end+VERIFY_TAIL > sz) { + printf("Bad used range for %p: "N64u".."N64u", allocation size "N64u", usable "N64u"\n", ptr, start, end, sz, sz-VERIFY_TAIL); + __builtin_trap(); + } } void tailVerifyReinit(void* ptr, u64 filled, u64 end) { if(filled>end || filled<=8) { printf("Bad reinit arguments: "N64u".."N64u"\n", filled, end); __builtin_trap(); }