Skip to content

Commit

Permalink
Fix bug in CYCLE_TRANS_INT
Browse files Browse the repository at this point in the history
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
  • Loading branch information
markusbaumeister authored and fingolfin committed Mar 20, 2018
1 parent 2d173a5 commit db5583e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/trans.c
Original file line number Diff line number Diff line change
Expand Up @@ -3102,6 +3102,7 @@ Obj FuncCYCLE_TRANS_INT(Obj self, Obj f, Obj pt)
i = cpt;
do {
AssPlist(out, ++len, INTOBJ_INT(i + 1));
ptf2 = CONST_ADDR_TRANS2(f);
i = ptf2[i];
} while (i != cpt);
}
Expand All @@ -3116,6 +3117,7 @@ Obj FuncCYCLE_TRANS_INT(Obj self, Obj f, Obj pt)
i = cpt;
do {
AssPlist(out, ++len, INTOBJ_INT(i + 1));
ptf4 = CONST_ADDR_TRANS4(f);
i = ptf4[i];
} while (i != cpt);
}
Expand Down

0 comments on commit db5583e

Please sign in to comment.