summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorferrieux <ferrieux@users.sourceforge.net>2011-08-09 17:19:33 (GMT)
committerferrieux <ferrieux@users.sourceforge.net>2011-08-09 17:19:33 (GMT)
commite83ec9b8978e9e4481a549283c64e11f2a1e4a61 (patch)
tree82fd16a3ebffc1553c7b6bb3847e036f9fd6cc61 /generic/tclExecute.c
parent653f52ba6008466571d283d523272ae22c2cf2c4 (diff)
downloadtcl-e83ec9b8978e9e4481a549283c64e11f2a1e4a61.zip
tcl-e83ec9b8978e9e4481a549283c64e11f2a1e4a61.tar.gz
tcl-e83ec9b8978e9e4481a549283c64e11f2a1e4a61.tar.bz2
[Bug 2919042] Restore "valgrindability" of Tcl that was lost by the streamlining of [exit], by conditionally forcing a full Finalize: use -DPURIFY or ::env(TCL_FINALIZE_ON_EXIT)
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index a7d6184..691c8d7 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -53,6 +53,8 @@
static int execInitialized = 0;
TCL_DECLARE_MUTEX(execMutex)
+static int cachedInExit = 0;
+
#ifdef TCL_COMPILE_DEBUG
/*
* Variable that controls whether execution tracing is enabled and, if so,
@@ -896,7 +898,7 @@ static void
DeleteExecStack(
ExecStack *esPtr)
{
- if (esPtr->markerPtr) {
+ if (esPtr->markerPtr && !cachedInExit) {
Tcl_Panic("freeing an execStack which is still in use");
}
@@ -915,6 +917,8 @@ TclDeleteExecEnv(
{
ExecStack *esPtr = eePtr->execStackPtr, *tmpPtr;
+ cachedInExit = TclInExit();
+
/*
* Delete all stacks in this exec env.
*/
@@ -930,10 +934,10 @@ TclDeleteExecEnv(
TclDecrRefCount(eePtr->constants[0]);
TclDecrRefCount(eePtr->constants[1]);
- if (eePtr->callbackPtr) {
- Tcl_Panic("Deleting execEnv with pending NRE callbacks!");
+ if (eePtr->callbackPtr && !cachedInExit) {
+ Tcl_Panic("Deleting execEnv with pending TEOV callbacks!");
}
- if (eePtr->corPtr) {
+ if (eePtr->corPtr && !cachedInExit) {
Tcl_Panic("Deleting execEnv with existing coroutine");
}
ckfree(eePtr);