diff options
author | dgp <dgp@users.sourceforge.net> | 2005-11-01 20:19:26 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2005-11-01 20:19:26 (GMT) |
commit | 239e8679aa5bc2c3e8db30277a67a2df86fc893a (patch) | |
tree | 3e0c0ef9b01b34839d99e90c3ac83e15926ea447 /generic/tclCmdMZ.c | |
parent | 20a6d5a7afe92a3d2c19ab3a2588ecbf20442f9d (diff) | |
download | tcl-239e8679aa5bc2c3e8db30277a67a2df86fc893a.zip tcl-239e8679aa5bc2c3e8db30277a67a2df86fc893a.tar.gz tcl-239e8679aa5bc2c3e8db30277a67a2df86fc893a.tar.bz2 |
* generic/tclCmdMZ.c (TclCheckExecutionTraces): Corrected mistaken
assumption that all command traces are set at the script level.
Report/fix from Jacques H. de Villiers. [Bug 1337941]
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r-- | generic/tclCmdMZ.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index b2f5919..f4c7765 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdMZ.c,v 1.82.2.22 2005/10/29 17:45:23 msofer Exp $ + * RCS: @(#) $Id: tclCmdMZ.c,v 1.82.2.23 2005/11/01 20:19:26 dgp Exp $ */ #include "tclInt.h" @@ -4223,19 +4223,21 @@ TclCheckExecutionTraces(interp, command, numChars, cmdPtr, code, active.reverseScan = 0; active.nextTracePtr = tracePtr->nextPtr; } - tcmdPtr = (TraceCommandInfo*)tracePtr->clientData; - if (tcmdPtr->flags != 0) { - tcmdPtr->curFlags = traceFlags | TCL_TRACE_EXEC_DIRECT; - tcmdPtr->curCode = code; - tcmdPtr->refCount++; - traceCode = TraceExecutionProc((ClientData)tcmdPtr, interp, - curLevel, command, (Tcl_Command)cmdPtr, objc, objv); - tcmdPtr->refCount--; - if (tcmdPtr->refCount < 0) { - Tcl_Panic("TclCheckExecutionTraces: negative TraceCommandInfo refCount"); - } - if (tcmdPtr->refCount == 0) { - ckfree((char*)tcmdPtr); + if (tracePtr->traceProc == TraceCommandProc) { + tcmdPtr = (TraceCommandInfo*)tracePtr->clientData; + if (tcmdPtr->flags != 0) { + tcmdPtr->curFlags = traceFlags | TCL_TRACE_EXEC_DIRECT; + tcmdPtr->curCode = code; + tcmdPtr->refCount++; + traceCode = TraceExecutionProc((ClientData)tcmdPtr, interp, + curLevel, command, (Tcl_Command)cmdPtr, objc, objv); + tcmdPtr->refCount--; + if (tcmdPtr->refCount < 0) { + Tcl_Panic("TclCheckExecutionTraces: negative TraceCommandInfo refCount"); + } + if (tcmdPtr->refCount == 0) { + ckfree((char*)tcmdPtr); + } } } if (active.nextTracePtr) { |