Pārlūkot izejas kodu

bugfix wrt interior pointers

Nicolas Cannasse 2 gadi atpakaļ
vecāks
revīzija
7ca9ab30b3
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  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--;