summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-06-10 23:34:45 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-06-10 23:34:45 (GMT)
commitac5377745066c2cc9fdc1d30ff2d449e2bb5b6d4 (patch)
tree0c318edc6eab5cd48c53db490c984ca7cab606ac /generic/tclBasic.c
parentf3f5448b0aa89dfc3c913d3f2e43e34e1c0c106c (diff)
downloadtcl-ac5377745066c2cc9fdc1d30ff2d449e2bb5b6d4.zip
tcl-ac5377745066c2cc9fdc1d30ff2d449e2bb5b6d4.tar.gz
tcl-ac5377745066c2cc9fdc1d30ff2d449e2bb5b6d4.tar.bz2
3532959 Arrange for every lambda to place an entry in the linePBodyPtr hash table.
Then the two teardowns of data in that table synchronize so that the first to run signals the other not to operate. Test proc-7.4 in a mem debug build of Tcl will detect Bug 3532959 by crashing.
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 1d289f2..fa13b50 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -1390,11 +1390,13 @@ DeleteInterpProc(
CmdFrame *cfPtr = Tcl_GetHashValue(hPtr);
Proc *procPtr = (Proc *) Tcl_GetHashKey(iPtr->linePBodyPtr, hPtr);
procPtr->iPtr = NULL;
- if (cfPtr->type == TCL_LOCATION_SOURCE) {
- Tcl_DecrRefCount(cfPtr->data.eval.path);
+ if (cfPtr) {
+ if (cfPtr->type == TCL_LOCATION_SOURCE) {
+ Tcl_DecrRefCount(cfPtr->data.eval.path);
+ }
+ ckfree((char *) cfPtr->line);
+ ckfree((char *) cfPtr);
}
- ckfree((char *) cfPtr->line);
- ckfree((char *) cfPtr);
Tcl_DeleteHashEntry(hPtr);
}
Tcl_DeleteHashTable(iPtr->linePBodyPtr);