summaryrefslogtreecommitdiffstats
path: root/generic/tclDictObj.c
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2010-02-24 14:30:31 (GMT)
committerdkf <dkf@noemail.net>2010-02-24 14:30:31 (GMT)
commit0ee37c8bb4821113a5c22eb83c0491e0dfa52211 (patch)
tree02ebdf02ca154c666a08cbc7e9b057a16e1dc918 /generic/tclDictObj.c
parent2c1521fbc454ff785e7f8a2e0492d19f37a5e49d (diff)
downloadtcl-0ee37c8bb4821113a5c22eb83c0491e0dfa52211.zip
tcl-0ee37c8bb4821113a5c22eb83c0491e0dfa52211.tar.gz
tcl-0ee37c8bb4821113a5c22eb83c0491e0dfa52211.tar.bz2
Fix some nasties with handling duplicate keys in list->dict->list conversions.
FossilOrigin-Name: 72dc5b9bbc7d9587c76f9eb277d2ab5fed357c69
Diffstat (limited to 'generic/tclDictObj.c')
-rw-r--r--generic/tclDictObj.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index dab4418..2751b4a 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.80 2009/11/18 21:59:51 nijtmans Exp $
+ * RCS: @(#) $Id: tclDictObj.c,v 1.81 2010/02/24 14:30:34 dkf Exp $
*/
#include "tclInt.h"
@@ -613,6 +613,14 @@ SetDictFromAny(
if (!isNew) {
Tcl_Obj *discardedValue = Tcl_GetHashValue(hPtr);
+ /*
+ * Not really a well-formed dictionary as there are duplicate
+ * keys, so better get the string rep here so that we can
+ * convert back.
+ */
+
+ (void) Tcl_GetString(objPtr);
+
TclDecrRefCount(discardedValue);
}
Tcl_SetHashValue(hPtr, objv[i+1]);