summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-10-02 12:38:30 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-10-02 12:38:30 (GMT)
commit5e88dcc48d62ffa8d6a6cb309bf9640936629494 (patch)
treea96831b22af8d5eee864bf40d387dc9ad3729941 /generic
parent1186f701edb58e2b02cd55a8ba71a3bbc00032d8 (diff)
downloadtcl-5e88dcc48d62ffa8d6a6cb309bf9640936629494.zip
tcl-5e88dcc48d62ffa8d6a6cb309bf9640936629494.tar.gz
tcl-5e88dcc48d62ffa8d6a6cb309bf9640936629494.tar.bz2
* generic/tclExecute.c (TEBCresume): [Bug 3079830]: Added invalidation
of string representations of dictionaries in some cases.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclExecute.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 606cca2..06c0948 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -14,7 +14,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.503 2010/10/02 00:23:44 hobbs Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.504 2010/10/02 12:38:30 dkf Exp $
*/
#include "tclInt.h"
@@ -5768,6 +5768,16 @@ TEBCresume(
Tcl_DictObjPut(NULL, dictPtr, OBJ_UNDER_TOS, valuePtr);
} else {
Tcl_AppendObjToObj(valuePtr, OBJ_AT_TOS);
+
+ /*
+ * Must invalidate the string representation of dictionary
+ * here because we have directly updated the internal
+ * representation; if we don't, callers could see the wrong
+ * string rep despite the internal version of the dictionary
+ * having the correct value. [Bug 3079830]
+ */
+
+ TclInvalidateStringRep(dictPtr);
}
break;
case INST_DICT_LAPPEND:
@@ -5798,6 +5808,16 @@ TEBCresume(
}
goto gotError;
}
+
+ /*
+ * Must invalidate the string representation of dictionary
+ * here because we have directly updated the internal
+ * representation; if we don't, callers could see the wrong
+ * string rep despite the internal version of the dictionary
+ * having the correct value. [Bug 3079830]
+ */
+
+ TclInvalidateStringRep(dictPtr);
}
break;
default:
@@ -6021,6 +6041,9 @@ TEBCresume(
if (allocdict) {
dictPtr = Tcl_DuplicateObj(dictPtr);
}
+ if (length > 0) {
+ TclInvalidateStringRep(dictPtr);
+ }
for (i=0 ; i<length ; i++) {
Var *var2Ptr = LOCAL(duiPtr->varIndices[i]);