From 5d93e97aaa566470cdfbcdf94fb90073e8b4e294 Mon Sep 17 00:00:00 2001 From: Chris Jefferson Date: Tue, 2 Feb 2016 09:49:36 +0000 Subject: [PATCH 1/3] Add missing CHANGED_BAG --- src/opers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/opers.c b/src/opers.c index 2b6d475be6..8df44ac884 100644 --- a/src/opers.c +++ b/src/opers.c @@ -5437,6 +5437,7 @@ Obj FuncNEW_OPERATION_ARGS ( list = NEW_PLIST( T_PLIST, 1 ); SET_LEN_PLIST( list, 1 ); SET_ELM_PLIST( list, 1, args ); + CHANGED_BAG( list ); return NewOperationArgs( name, -1, list ); } From eb67a6f81f20c386707329131814adede37c53c9 Mon Sep 17 00:00:00 2001 From: Chris Jefferson Date: Tue, 2 Feb 2016 10:27:04 +0000 Subject: [PATCH 2/3] Add missing CHANGED_BAG calls --- src/opers.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/opers.c b/src/opers.c index 8df44ac884..0b29289afd 100644 --- a/src/opers.c +++ b/src/opers.c @@ -1613,6 +1613,7 @@ Obj CallHandleMethodNotFound( Obj oper, SET_LEN_PLIST(arglist,nargs); for (i = 0; i < nargs; i++) SET_ELM_PLIST( arglist, i+1, args[i]); + CHANGED_BAG(arglist); AssPRec(r,RNamArguments,arglist); AssPRec(r,RNamIsVerbose,verbose ? True : False); AssPRec(r,RNamIsConstructor,constructor ? True : False); @@ -6321,15 +6322,18 @@ static Int InitLibrary ( C_NEW_STRING_CONST( str, "obj" ); RESET_FILT_LIST( str, FN_IS_MUTABLE ); SET_ELM_PLIST( ArglistObj, 1, str ); + CHANGED_BAG( ArglistObj ); ArglistObjVal = NEW_PLIST( T_PLIST+IMMUTABLE, 2 ); SET_LEN_PLIST( ArglistObjVal, 2 ); C_NEW_STRING_CONST( str, "obj" ); RESET_FILT_LIST( str, FN_IS_MUTABLE ); SET_ELM_PLIST( ArglistObjVal, 1, str ); + CHANGED_BAG( ArglistObjVal ); C_NEW_STRING_CONST( str, "val" ); RESET_FILT_LIST( str, FN_IS_MUTABLE ); SET_ELM_PLIST( ArglistObjVal, 2, str ); + CHANGED_BAG( ArglistObjVal ); HIDDEN_IMPS = NEW_PLIST(T_PLIST, 0); SET_LEN_PLIST(HIDDEN_IMPS, 0); From 5973aee2917e267540371ff8ec190168c87b81eb Mon Sep 17 00:00:00 2001 From: Chris Jefferson Date: Tue, 2 Feb 2016 18:12:47 +0000 Subject: [PATCH 3/3] Fix two GC issues: Split assignment into two pieces and add missing CHANGED_BAG --- src/opers.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/opers.c b/src/opers.c index 0b29289afd..8c2ad00739 100644 --- a/src/opers.c +++ b/src/opers.c @@ -5156,6 +5156,7 @@ Obj NewOperationArgs ( Obj nams ) { Obj func; + Obj namobj; /* create the function */ func = NewFunctionT( T_FUNCTION, SIZE_FUNC, name, narg, nams, @@ -5178,7 +5179,9 @@ Obj NewOperationArgs ( } /* added the name */ - NAME_FUNC(func) = CopyObj( name, 0 ); + namobj = CopyObj( name, 0 ); + NAME_FUNC(func) = namobj; + CHANGED_BAG(func); /* and return */ return func;