mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-10 22:37:38 +02:00
At least for now, exit on error so we can try to track them down
This commit is contained in:
parent
fc29269a26
commit
173e1ca407
1 changed files with 9 additions and 3 deletions
12
gc.c
12
gc.c
|
@ -327,12 +327,18 @@ size_t gc_sweep(gc_heap *h, size_t *sum_freed_ptr)
|
|||
|
||||
//#if GC_DEBUG_CONCISE_PRINTFS
|
||||
// DEBUG
|
||||
if (!is_object_type(p))
|
||||
if (!is_object_type(p)) {
|
||||
fprintf(stderr, "sweep: invalid object at %p", p);
|
||||
if ((char *)q + q->size > (char *)p)
|
||||
exit(1);
|
||||
}
|
||||
if ((char *)q + q->size > (char *)p) {
|
||||
fprintf(stderr, "bad size at %p < %p + %u", p, q, q->size);
|
||||
if (r && ((char *)p) + size > (char *)r)
|
||||
exit(1);
|
||||
}
|
||||
if (r && ((char *)p) + size > (char *)r) {
|
||||
fprintf(stderr, "sweep: bad size at %p + %d > %p", p, size, r);
|
||||
exit(1);
|
||||
}
|
||||
// END DEBUG
|
||||
//#endif
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue