From 239e8679aa5bc2c3e8db30277a67a2df86fc893a Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 1 Nov 2005 20:19:26 +0000 Subject: * 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] --- ChangeLog | 4 ++++ generic/tclCmdMZ.c | 30 ++++++++++++++++-------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b8c170..9232bb0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2005-11-01 Don Porter + * 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] + * tests/expr-old.test (expr-32.52): Use int(.) to restrict result of left shift to the C long range. 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) { -- cgit v0.12