summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdIL.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-03-02 16:06:32 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-03-02 16:06:32 (GMT)
commit986970a95155cda5c067008629993af20bd86e52 (patch)
treef9f063c96e5318002932be73d790641f69af4fd4 /generic/tclCmdIL.c
parent7fe6552f08334298693e15b6a8b53f8cd27ff2c4 (diff)
downloadtcl-986970a95155cda5c067008629993af20bd86e52.zip
tcl-986970a95155cda5c067008629993af20bd86e52.tar.gz
tcl-986970a95155cda5c067008629993af20bd86e52.tar.bz2
Added comments warning against certain optimizations
Diffstat (limited to 'generic/tclCmdIL.c')
-rw-r--r--generic/tclCmdIL.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index 734c1dd..05aa154 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -16,7 +16,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdIL.c,v 1.104 2007/03/02 15:11:20 dgp Exp $
+ * RCS: @(#) $Id: tclCmdIL.c,v 1.105 2007/03/02 16:06:32 dgp Exp $
*/
#include "tclInt.h"
@@ -3309,6 +3309,15 @@ Tcl_LreplaceObjCmd(
if (Tcl_IsShared(listPtr)) {
listPtr = TclListObjCopy(NULL, listPtr);
}
+
+ /*
+ * Note that we call Tcl_ListObjReplace even when numToDelete == 0
+ * and objc == 4. In this case, the list value of listPtr is not
+ * changed (no elements are removed or added), but by making the
+ * call we are assured we end up with a list in canonical form.
+ * Resist any temptation to optimize this case away.
+ */
+
Tcl_ListObjReplace(NULL, listPtr, first, numToDelete, objc-4, &(objv[4]));
/*