summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--generic/tclDictObj.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index d60fa16..147058a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2009-01-06 Donal K. Fellows <dkf@users.sf.net>
+ * generic/tclDictObj.c (DictIncrCmd): Corrected twiddling in internals
+ of dictionaries so that literals can't get destroyed.
+
* tests/expr.test, tests/string.test: Eliminate non-ASCII characters.
[Bugs 2006884, 2006879]
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index c74f10f..fc1cac1 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -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: tclDictObj.c,v 1.56.2.1 2008/07/20 22:02:37 dkf Exp $
+ * RCS: @(#) $Id: tclDictObj.c,v 1.56.2.2 2009/01/06 16:07:17 dkf Exp $
*/
#include "tclInt.h"
@@ -2129,10 +2129,11 @@ DictIncrCmd(
*/
char *saved = dictPtr->bytes;
+ Tcl_Obj *oldPtr = dictPtr;
dictPtr->bytes = NULL;
dictPtr = Tcl_DuplicateObj(dictPtr);
- dictPtr->bytes = saved;
+ oldPtr->bytes = saved;
}
if (valuePtr == NULL) {
/*