summaryrefslogtreecommitdiffstats
path: root/generic/tclDictObj.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2008-07-18 04:23:35 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2008-07-18 04:23:35 (GMT)
commit306e6900a04b226e12b76ba8d7c4366b0b336c9a (patch)
tree59fcb5999c458580b7d132e00c5906ceb08b3037 /generic/tclDictObj.c
parent222e9f575e6b44d31e1bdc5c84430c514465e32d (diff)
downloadtcl-306e6900a04b226e12b76ba8d7c4366b0b336c9a.zip
tcl-306e6900a04b226e12b76ba8d7c4366b0b336c9a.tar.gz
tcl-306e6900a04b226e12b76ba8d7c4366b0b336c9a.tar.bz2
* generic/tclDictObj.c (DictWithCmd, DictUpdateCmd): fix
refcounting bugs that caused crashes [Bug 2017857]. * generic/tclBasic.c (TclNREvalObjEx): streamline the management of the command frame (opt).
Diffstat (limited to 'generic/tclDictObj.c')
-rw-r--r--generic/tclDictObj.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index 9764c30..9cf2739 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.61 2008/07/17 21:57:15 dkf Exp $
+ * RCS: @(#) $Id: tclDictObj.c,v 1.62 2008/07/18 04:23:55 msofer Exp $
*/
#include "tclInt.h"
@@ -2931,13 +2931,10 @@ DictUpdateCmd(
objPtr = Tcl_NewListObj(objc-3, objv+2);
Tcl_IncrRefCount(objPtr);
+ Tcl_IncrRefCount(objv[1]);
TclNR_AddCallback(interp, FinalizeDictUpdate, objv[1], objPtr, NULL,NULL);
-#if 0
- /* This crashes when doing nested [dict update]s. */
+
return TclNREvalObjEx(interp, objv[objc-1], 0, iPtr->cmdFramePtr, objc-1);
-#else
- return TclNR_EvalObj(interp, objv[objc-1], 0);
-#endif
}
static int
@@ -3111,16 +3108,13 @@ DictWithCmd(
pathPtr = NULL;
if (objc > 3) {
pathPtr = Tcl_NewListObj(objc-3, objv+2);
+ Tcl_IncrRefCount(pathPtr);
}
Tcl_IncrRefCount(objv[1]);
TclNR_AddCallback(interp, FinalizeDictWith, objv[1], keysPtr, pathPtr,
NULL);
-#if 0
- /* This crashes when doing nested [dict with]s. */
+
return TclNREvalObjEx(interp, objv[objc-1], 0, iPtr->cmdFramePtr, objc-1);
-#else
- return TclNR_EvalObj(interp, objv[objc-1], 0);
-#endif
}
static int