diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclBasic.c | 2 | ||||
-rw-r--r-- | generic/tclCmdAH.c | 13 | ||||
-rw-r--r-- | generic/tclCmdIL.c | 17 | ||||
-rw-r--r-- | generic/tclEnsemble.c | 2 | ||||
-rw-r--r-- | generic/tclEvent.c | 2 | ||||
-rw-r--r-- | generic/tclUtil.c | 2 |
6 files changed, 25 insertions, 13 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 8b6df79..1997a5d 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -6153,7 +6153,7 @@ TclNREvalObjEx( */ Tcl_IncrRefCount(objPtr); - listPtr = Tcl_DuplicateObj(objPtr); + listPtr = TclListObjCopy(interp, objPtr); Tcl_IncrRefCount(listPtr); if (word != INT_MIN) { diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 42121f6..0245eed 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -2787,7 +2787,11 @@ EachloopCmd( for (i=0 ; i<numLists ; i++) { /* List */ /* Variables */ - statePtr->vCopyList[i] = Tcl_DuplicateObj(objv[1+i*2]); + statePtr->vCopyList[i] = TclListObjCopy(interp, objv[1+i*2]); + if (statePtr->vCopyList[i] == NULL) { + result = TCL_ERROR; + goto done; + } result = TclListObjLengthM(interp, statePtr->vCopyList[i], &statePtr->varcList[i]); if (result != TCL_OK) { @@ -2818,7 +2822,12 @@ EachloopCmd( /* Don't compute values here, wait until the last moment */ statePtr->argcList[i] = TclObjTypeLength(statePtr->aCopyList[i]); } else { - statePtr->aCopyList[i] = Tcl_DuplicateObj(objv[2+i*2]); + /* List values */ + statePtr->aCopyList[i] = TclListObjCopy(interp, objv[2+i*2]); + if (statePtr->aCopyList[i] == NULL) { + result = TCL_ERROR; + goto done; + } result = TclListObjGetElementsM(interp, statePtr->aCopyList[i], &statePtr->argcList[i], &statePtr->argvList[i]); if (result != TCL_OK) { diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index b6b4900..9c77eed 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -2315,7 +2315,10 @@ Tcl_LassignObjCmd( return TCL_ERROR; } - listCopyPtr = Tcl_DuplicateObj(objv[1]); + listCopyPtr = TclListObjCopy(interp, objv[1]); + if (listCopyPtr == NULL) { + return TCL_ERROR; + } Tcl_IncrRefCount(listCopyPtr); /* Important! fs */ code = TclListObjGetElementsM( @@ -2482,7 +2485,7 @@ Tcl_LinsertObjCmd( listPtr = objv[1]; if (Tcl_IsShared(listPtr)) { - listPtr = Tcl_DuplicateObj(listPtr); + listPtr = TclListObjCopy(NULL, listPtr); copied = 1; } @@ -2684,7 +2687,7 @@ Tcl_LpopObjCmd( if (objc == 2) { if (Tcl_IsShared(listPtr)) { - listPtr = Tcl_DuplicateObj(listPtr); + listPtr = TclListObjCopy(NULL, listPtr); copied = 1; } result = Tcl_ListObjReplace(interp, listPtr, listLen - 1, 1, 0, NULL); @@ -2874,7 +2877,7 @@ Tcl_LremoveObjCmd( */ if (Tcl_IsShared(listObj)) { - listObj = Tcl_DuplicateObj(listObj); + listObj = TclListObjCopy(NULL, listObj); copied = 1; } num = 0; @@ -3126,7 +3129,7 @@ Tcl_LreplaceObjCmd( listPtr = objv[1]; if (Tcl_IsShared(listPtr)) { - listPtr = Tcl_DuplicateObj(listPtr); + listPtr = TclListObjCopy(NULL, listPtr); } /* @@ -4759,7 +4762,7 @@ Tcl_LsortObjCmd( * 1675116] */ - listObj = Tcl_DuplicateObj(listObj); + listObj = TclListObjCopy(interp, listObj); if (listObj == NULL) { sortInfo.resultCode = TCL_ERROR; goto done; @@ -5115,7 +5118,7 @@ Tcl_LeditObjCmd( } if (Tcl_IsShared(listPtr)) { - listPtr = Tcl_DuplicateObj(listPtr); + listPtr = TclListObjCopy(NULL, listPtr); createdNewObj = 1; } else { createdNewObj = 0; diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 9e13c93..671656e 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -1904,7 +1904,7 @@ NsEnsembleImplementationCmdNR( TclListObjLengthM(NULL, prefixObj, &prefixObjc); if (objc == 2) { - copyPtr = Tcl_DuplicateObj(prefixObj); + copyPtr = TclListObjCopy(NULL, prefixObj); } else { copyPtr = Tcl_NewListObj(objc - 2 + prefixObjc, NULL); Tcl_ListObjAppendList(NULL, copyPtr, prefixObj); diff --git a/generic/tclEvent.c b/generic/tclEvent.c index 57287f8..8fb309d 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -232,7 +232,7 @@ HandleBgErrors( * support one handler setting another handler. */ - Tcl_Obj *copyObj = Tcl_DuplicateObj(assocPtr->cmdPrefix); + Tcl_Obj *copyObj = TclListObjCopy(NULL, assocPtr->cmdPrefix); errPtr = assocPtr->firstBgPtr; diff --git a/generic/tclUtil.c b/generic/tclUtil.c index cf1950c..fc157d0 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -2010,7 +2010,7 @@ Tcl_ConcatObj( } Tcl_BumpObj(elemPtr); // could be an an abstract list element } else { - resPtr = Tcl_DuplicateObj(objPtr); + resPtr = TclListObjCopy(NULL, objPtr); } } if (!resPtr) { |