Skip to content

Commit 83bcd09

Browse files
committed
Fix bug with root scanning during compaction (#39)
1 parent 1b5ec83 commit 83bcd09

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

runtime/roots_nat.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,10 @@ static int visit(scanning_action maj, scanning_action min,
399399
return 0;
400400

401401
hd = Hd_val(vblock);
402-
if (Tag_hd(hd) == Infix_tag) {
402+
/* Compaction can create things that look like Infix_tag,
403+
but have color Caml_gray (cf. eptr in compact.c).
404+
So, check Color_hd(hd) too. */
405+
if (Color_hd(hd) == 0 && Tag_hd(hd) == Infix_tag) {
403406
vblock -= Infix_offset_val(v);
404407
hd = Hd_val(vblock);
405408
}

0 commit comments

Comments
 (0)