summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-03-02 17:56:25 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-03-02 17:56:25 (GMT)
commitcd496d782fff1c8e8c78906717567c871519387e (patch)
treee709815aec1006f933b22e85f6406763f51ede60
parent986970a95155cda5c067008629993af20bd86e52 (diff)
downloadtcl-cd496d782fff1c8e8c78906717567c871519387e.zip
tcl-cd496d782fff1c8e8c78906717567c871519387e.tar.gz
tcl-cd496d782fff1c8e8c78906717567c871519387e.tar.bz2
* generic/tclCmdIL.c (Tcl_LreverseObjCmd): Added missing
TclInvalidateStringRep() call when we directly manipulate the intrep of an unshared "list" Tcl_Obj. [Bug 1672585].
-rw-r--r--ChangeLog4
-rw-r--r--generic/tclCmdIL.c3
-rw-r--r--tests/cmdIL.test5
3 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 911f166..79e83d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2007-03-02 Don Porter <dgp@users.sourceforge.net>
+ * generic/tclCmdIL.c (Tcl_LreverseObjCmd): Added missing
+ TclInvalidateStringRep() call when we directly manipulate the
+ intrep of an unshared "list" Tcl_Obj. [Bug 1672585].
+
* generic/tclCmdIL.c (Tcl_JoinObjCmd): Revised [join] implementation
to append Tcl_Obj's instead of strings. [RFE 1669420]
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index 05aa154..c288789 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.105 2007/03/02 16:06:32 dgp Exp $
+ * RCS: @(#) $Id: tclCmdIL.c,v 1.106 2007/03/02 17:56:26 dgp Exp $
*/
#include "tclInt.h"
@@ -3389,6 +3389,7 @@ Tcl_LreverseObjCmd(
elemv[i] = elemv[j];
elemv[j] = tmp;
}
+ TclInvalidateStringRep(objv[1]);
Tcl_SetObjResult(interp, objv[1]);
}
return TCL_OK;
diff --git a/tests/cmdIL.test b/tests/cmdIL.test
index 87af599..083d393 100644
--- a/tests/cmdIL.test
+++ b/tests/cmdIL.test
@@ -8,7 +8,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: cmdIL.test,v 1.30 2006/11/09 16:11:46 dkf Exp $
+# RCS: @(#) $Id: cmdIL.test,v 1.31 2007/03/02 17:56:27 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -740,6 +740,9 @@ test cmdIL-7.4 {lreverse command - shared object} {
test cmdIL-7.5 {lreverse command - unshared object} {
lreverse [list a b {c d} e f]
} {f e {c d} b a}
+test cmdIL-7.6 {lreverse command - unshared object [Bug 1672585]} {
+ lreverse [set x {1 2 3}][unset x]
+} {3 2 1}
# cleanup
::tcltest::cleanupTests