summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2006-11-04 00:09:33 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2006-11-04 00:09:33 (GMT)
commitf0fce3b27df91a506d77ccc5bfec17437a6f079e (patch)
treec4cd241ddf7134b92ba6b59f0f9d58ced641fa38
parent582529b442db759535075226bac5cb74b4b5c783 (diff)
downloadtcl-f0fce3b27df91a506d77ccc5bfec17437a6f079e.zip
tcl-f0fce3b27df91a506d77ccc5bfec17437a6f079e.tar.gz
tcl-f0fce3b27df91a506d77ccc5bfec17437a6f079e.tar.bz2
* generic/tclBasic.c (TEOVI): fix por possible leak of a Command
in the presence of execution traces that delete it.
-rw-r--r--ChangeLog3
-rw-r--r--generic/tclBasic.c8
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index c3250cd..3883a50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2006-11-03 Miguel Sofer <msofer@users.sf.net>
+ * generic/tclBasic.c (TEOVI): fix por possible leak of a Command
+ in the presence of execution traces that delete it.
+
* generic/tclBasic.c (TEOVI):
* tests/trace.test (trace-21.11): fix for [Bug 1590232], execution
traces may cause a second command resolution in the wrong
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 0f5c535..40cc7fb 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.215 2006/11/03 23:24:43 msofer Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.216 2006/11/04 00:09:33 msofer Exp $
*/
#include "tclInt.h"
@@ -3418,6 +3418,7 @@ TclEvalObjvInternal(
if (checkTraces && (command != NULL)) {
int cmdEpoch = cmdPtr->cmdEpoch;
+ int newEpoch;
/*
* Execute any command or execution traces. Note that we bump up the
@@ -3434,7 +3435,8 @@ TclEvalObjvInternal(
traceCode = TclCheckExecutionTraces(interp, command, length,
cmdPtr, code, TCL_TRACE_ENTER_EXEC, objc, objv);
}
- cmdPtr->refCount--;
+ newEpoch = cmdPtr->cmdEpoch;
+ TclCleanupCommand(cmdPtr);
/*
* If the traces modified/deleted the command or any existing traces,
@@ -3444,7 +3446,7 @@ TclEvalObjvInternal(
* implementation.
*/
- if (cmdEpoch != cmdPtr->cmdEpoch) {
+ if (cmdEpoch != newEpoch) {
checkTraces = 0;
goto reparseBecauseOfTraces;
}