File tree 2 files changed +18
-2
lines changed
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -1647,6 +1647,7 @@ struct Gcx
1647
1647
else
1648
1648
{
1649
1649
// we are in a B_FREE page
1650
+ assert (bin == B_FREE );
1650
1651
return null ;
1651
1652
}
1652
1653
}
@@ -2324,6 +2325,7 @@ struct Gcx
2324
2325
else
2325
2326
{
2326
2327
// Don't mark bits in B_FREE pages
2328
+ assert (bin == B_FREE );
2327
2329
continue ;
2328
2330
}
2329
2331
@@ -2630,7 +2632,7 @@ struct Gcx
2630
2632
toClear |= GCBits.BITS_1 << clearIndex;
2631
2633
2632
2634
List * list = cast (List * )p;
2633
- debug (PRINTF ) printf(" \t collecting %p\n " , list);
2635
+ debug (COLLECT_PRINTF ) printf(" \t collecting %p\n " , list);
2634
2636
log_free(sentinel_add(list));
2635
2637
2636
2638
debug (MEMSTOMP ) memset(p, 0xF3 , size);
@@ -2744,11 +2746,16 @@ struct Gcx
2744
2746
{
2745
2747
biti = (offset & notbinsize[bins]) >> pool.shiftBy;
2746
2748
}
2747
- else
2749
+ else if (bins == B_PAGEPLUS )
2748
2750
{
2749
2751
pn -= pool.bPageOffsets[pn];
2750
2752
biti = pn * (PAGESIZE >> pool.shiftBy);
2751
2753
}
2754
+ else // bins == B_FREE
2755
+ {
2756
+ assert (bins == B_FREE );
2757
+ return IsMarked.no;
2758
+ }
2752
2759
return pool.mark.test(biti) ? IsMarked.yes : IsMarked.no;
2753
2760
}
2754
2761
return IsMarked.unknown;
Original file line number Diff line number Diff line change @@ -421,6 +421,15 @@ void processGCMarks(BlkInfo* cache, scope rt.tlsgc.IsMarkedDg isMarked)
421
421
}
422
422
}
423
423
424
+ unittest
425
+ {
426
+ import core.memory ;
427
+ // Bugzilla 10701 - segfault in GC
428
+ ubyte [] result; result.length = 4096 ;
429
+ GC .free(result.ptr);
430
+ GC .collect();
431
+ }
432
+
424
433
/**
425
434
Get the cached block info of an interior pointer. Returns null if the
426
435
interior pointer's block is not cached.
You can’t perform that action at this time.
0 commit comments