diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-12-27 15:05:28 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-12-27 15:05:28 (GMT) |
commit | 25684743a9629d0b8645c505a6856cc7e2bc9180 (patch) | |
tree | 50404fb0a39698c9462bd2ceee8c74c909f28a20 /generic/tclListObj.c | |
parent | 4a9549053c5065a1fd09b601851548e7418967c0 (diff) | |
parent | 3179079214bd7ec9eecf26f71b91ea8d5c7308d1 (diff) | |
download | tcl-25684743a9629d0b8645c505a6856cc7e2bc9180.zip tcl-25684743a9629d0b8645c505a6856cc7e2bc9180.tar.gz tcl-25684743a9629d0b8645c505a6856cc7e2bc9180.tar.bz2 |
merge trunk
Diffstat (limited to 'generic/tclListObj.c')
-rw-r--r-- | generic/tclListObj.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 3668b45..53c3f66 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -909,6 +909,10 @@ Tcl_ListObjReplace( isShared = (listRepPtr->refCount > 1); numRequired = numElems - count + objc; + for (i = 0; i < objc; i++) { + Tcl_IncrRefCount(objv[i]); + } + if ((numRequired <= listRepPtr->maxElemCount) && !isShared) { int shift; @@ -1027,14 +1031,11 @@ Tcl_ListObjReplace( } /* - * Insert the new elements into elemPtrs before "first". We don't do a - * memcpy here because we must increment the reference counts for the - * added elements, so we must explicitly loop anyway. + * Insert the new elements into elemPtrs before "first". */ for (i=0,j=first ; i<objc ; i++,j++) { elemPtrs[j] = objv[i]; - Tcl_IncrRefCount(objv[i]); } /* |