Skip to content

Commit

Permalink
kernel: fix bug in MarkWeakPointerObj during copying
Browse files Browse the repository at this point in the history
We did not mark the forwarding pointer when copying.
  • Loading branch information
fingolfin authored and ChrisJefferson committed Sep 6, 2018
1 parent 89d34fc commit fe8f60c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/weakptr.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,12 @@ Obj FuncIsWPObj( Obj self, Obj wp)

static void MarkWeakPointerObj(Obj wp)
{
#if !defined(USE_THREADSAFE_COPYING)
// mark the forwarding pointer
if (TNUM_OBJ(wp) == T_WPOBJ + COPYING)
MarkBag(CONST_ADDR_OBJ(wp)[0]);
#endif

// can't use the stored length here, in case we are in the middle of
// copying
const UInt len = SIZE_BAG(wp) / sizeof(Obj) - 1;
Expand Down

0 comments on commit fe8f60c

Please sign in to comment.