From db5583e7211a933aba83a352a13c25b94bf2b9d0 Mon Sep 17 00:00:00 2001 From: Markus Baumeister Date: Wed, 7 Mar 2018 16:18:51 +0100 Subject: [PATCH] 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 --- src/trans.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/trans.c b/src/trans.c index deb8071725..f0ea6c1ea1 100644 --- a/src/trans.c +++ b/src/trans.c @@ -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); } @@ -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); }