summaryrefslogtreecommitdiffstats
path: root/generic/tclDictObj.c
diff options
context:
space:
mode:
authormsofer <msofer@noemail.net>2008-07-18 04:23:34 (GMT)
committermsofer <msofer@noemail.net>2008-07-18 04:23:34 (GMT)
commit7e14b9a1c9b835cb621756f53b8b3d6d938f5a17 (patch)
tree59fcb5999c458580b7d132e00c5906ceb08b3037 /generic/tclDictObj.c
parenta0bf1c06d734d73377dd142a6b52102b4187ff74 (diff)
downloadtcl-7e14b9a1c9b835cb621756f53b8b3d6d938f5a17.zip
tcl-7e14b9a1c9b835cb621756f53b8b3d6d938f5a17.tar.gz
tcl-7e14b9a1c9b835cb621756f53b8b3d6d938f5a17.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). FossilOrigin-Name: d36c5fb6d68b885aa7e317d8d9b4541e045a5fbf
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