From 0fdf7390864f8bc619741aff777cb5d2560d9f1c Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 7 Oct 2016 21:50:47 -0700 Subject: gc issues in clear_struct and replace_struct. * struct.c (clear_struct, reset_struct): Inform the garbage collector that the structure has been mutate, using the mut macro. This is required for correctness because the structure may be a mature object receiving young generation values. --- struct.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'struct.c') diff --git a/struct.c b/struct.c index f42c685b..f8ed361d 100644 --- a/struct.c +++ b/struct.c @@ -599,6 +599,8 @@ val clear_struct(val strct, val value) for (i = 0; i < st->nslots; i++) si->slot[i] = clear_val; + mut(strct); + return strct; } @@ -621,6 +623,7 @@ val replace_struct(val target, val source) free(tsi); target->co.handle = coerce(mem_t *, ssi_copy); target->co.cls = source->co.cls; + mut(target); } return target; -- cgit v1.2.3