From 8c71fd22422d60b3d1e40069b13b73bb447ef4a4 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Tue, 3 Nov 2020 00:07:08 -0500 Subject: [PATCH] Use more cloneObject() --- src/pebblisp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pebblisp.c b/src/pebblisp.c index 498069b..bd25c56 100644 --- a/src/pebblisp.c +++ b/src/pebblisp.c @@ -340,14 +340,14 @@ Object filter(Object obj1, Object obj2, struct Environment *env) Object append(Object list, Object newElement, struct Environment *env) { Object newList = cloneObject(list); - nf_addToList(&newList, newElement); + nf_addToList(&newList, cloneObject(newElement)); return newList; } Object prepend(Object list, Object newElement, struct Environment *env) { Object newList = listObject(); - nf_addToList(&newList, newElement); + nf_addToList(&newList, cloneObject(newElement)); appendList(&newList, &list); return newList; } @@ -364,7 +364,7 @@ Object rest(Object list, Object ignore, struct Environment *env) FOR_POINTER_IN_LIST(l) { if(POINTER == l->list) continue; - nf_addToList(&ret, *POINTER); + nf_addToList(&ret, cloneObject(*POINTER)); } return ret; }