From f56a68cadc32f26baa5dc40a732f99ea1644dc45 Mon Sep 17 00:00:00 2001 From: Chris Jefferson Date: Mon, 21 Jan 2019 19:15:25 +0000 Subject: [PATCH] Add missing CHANGED_BAG in PushValue --- src/code.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/code.c b/src/code.c index 5bd41b276a..fa804b0e89 100644 --- a/src/code.c +++ b/src/code.c @@ -520,8 +520,12 @@ static Int PushValue(Obj val) Obj values = header->values; if (!values) { values = NEW_PLIST(T_PLIST, 4); + // Recalculate header in case NEW_PLIST caused a GC header = (BodyHeader *)STATE(PtrBody); header->values = values; + GAP_ASSERT(STATE(PtrBody) == (Stat *)PTR_BAG(BODY_FUNC(CURR_FUNC()))); + // This is the bag PtrBody points at + CHANGED_BAG(BODY_FUNC(CURR_FUNC())); } return PushPlist(values, val); }