Browse Source

bugfix wrt interior pointers

Nicolas Cannasse 2 years ago
parent
commit
7ca9ab30b3
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/allocator.c

+ 1 - 0
src/allocator.c

@@ -533,6 +533,7 @@ static int gc_allocator_get_block_interior( gc_pheader *page, void **block ) {
 	int offset = (int)((unsigned char*)*block - page->base);
 	int bid = offset / page->alloc.block_size;
 	if( page->alloc.sizes ) {
+		if( bid < page->alloc.first_block ) return -1;
 		while( page->alloc.sizes[bid] == 0 ) {
 			if( bid == page->alloc.first_block ) return -1;
 			bid--;