From 1543ed93f676abd629ea913bfde2e73f180fe7af Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 6 Jan 2009 16:03:46 +0000 Subject: Corrected twiddling in internals of dictionaries so that literals can't get destroyed. --- ChangeLog | 3 +++ generic/tclDictObj.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2023ea8..9e4959e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-01-06 Donal K. Fellows + * generic/tclDictObj.c (DictIncrCmd): Corrected twiddling in internals + of dictionaries so that literals can't get destroyed. + * tests/expr.test: Eliminate non-ASCII char. [Bug 2006879] * generic/tclOOInfo.c (InfoObjectMethodsCmd,InfoClassMethodsCmd): Only diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index f895555..666cf46 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.72 2008/12/10 11:15:05 dkf Exp $ + * RCS: @(#) $Id: tclDictObj.c,v 1.73 2009/01/06 16:03:47 dkf Exp $ */ #include "tclInt.h" @@ -2137,10 +2137,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) { /* -- cgit v0.12