Skip to content

Commit d3af460

Browse files
Fix bug in CYCLE_TRANS_INT
The addition of CycleFromList uncovered a bug in CYCLE_TRANS_INT. This patch by Max Horn hopefully fixes that. His failure description (abbreviated) was: The problem is that `AssPlist` can trigger a GC. The change by chance happened to fill the heap in such a way that a GC happened at that spot
1 parent 6039e1a commit d3af460

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/trans.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3102,6 +3102,7 @@ Obj FuncCYCLE_TRANS_INT(Obj self, Obj f, Obj pt)
31023102
i = cpt;
31033103
do {
31043104
AssPlist(out, ++len, INTOBJ_INT(i + 1));
3105+
ptf2 = CONST_ADDR_TRANS2(f);
31053106
i = ptf2[i];
31063107
} while (i != cpt);
31073108
}
@@ -3116,6 +3117,7 @@ Obj FuncCYCLE_TRANS_INT(Obj self, Obj f, Obj pt)
31163117
i = cpt;
31173118
do {
31183119
AssPlist(out, ++len, INTOBJ_INT(i + 1));
3120+
ptf4 = CONST_ADDR_TRANS4(f);
31193121
i = ptf4[i];
31203122
} while (i != cpt);
31213123
}

0 commit comments

Comments
 (0)