summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-08-18 21:19:16 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-08-18 21:19:16 (GMT)
commit2d85aae311a521f058f675ea276215ec029e5b4a (patch)
treee64f33c09c733ea6218a8de1dec3b5095ef0fe05
parenta5bfad10548c5263783092ab97dc6ecb3bf7544d (diff)
downloadtcl-2d85aae311a521f058f675ea276215ec029e5b4a.zip
tcl-2d85aae311a521f058f675ea276215ec029e5b4a.tar.gz
tcl-2d85aae311a521f058f675ea276215ec029e5b4a.tar.bz2
[kennykb_numerics_branch]
* generic/tclExecute.c: Fixed string rep invalidation bug in * tests/dict.test (dict-11.17): INST_DICT_INCR_IMM rewrite.
-rw-r--r--ChangeLog3
-rw-r--r--generic/tclExecute.c5
-rw-r--r--tests/dict.test9
3 files changed, 15 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b03a715..9bdf84b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
[kennykb_numerics_branch]
+ * generic/tclExecute.c: Fixed string rep invalidation bug in
+ * tests/dict.test (dict-11.17): INST_DICT_INCR_IMM rewrite.
+
* generic/tclDictObj.c: DictIncrCmd rewrite to use TclIncrObj.
* generic/tclInt.h: TclIncrObj static -> internal
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index bb05b03..acbc0e1 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclExecute.c,v 1.167.2.26 2005/08/18 18:18:46 dgp Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.167.2.27 2005/08/18 21:19:17 dgp Exp $
*/
#include "tclInt.h"
@@ -5670,6 +5670,9 @@ TclExecuteByteCode(interp, codePtr)
Tcl_DictObjPut(NULL, dictPtr, *tosPtr, valPtr);
}
result = TclIncrObj(interp, valPtr, incrPtr);
+ if (result == TCL_OK) {
+ Tcl_InvalidateStringRep(dictPtr);
+ }
Tcl_DecrRefCount(incrPtr);
}
break;
diff --git a/tests/dict.test b/tests/dict.test
index 3efd302..d722983 100644
--- a/tests/dict.test
+++ b/tests/dict.test
@@ -9,7 +9,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: dict.test,v 1.12.2.1 2005/08/02 18:16:23 dgp Exp $
+# RCS: @(#) $Id: dict.test,v 1.12.2.2 2005/08/18 21:19:17 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -317,6 +317,13 @@ test dict-11.16 {dict incr command: compilation} {
}
dicttest
} {1 1 2 3}
+test dict-11.17 {dict incr command: compilation} {
+ proc dicttest {} {
+ set dictv {a 1}
+ dict incr dictv a 2
+ }
+ dicttest
+} {a 3}
test dict-12.1 {dict lappend command} {
set dictv {a a}