summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--generic/tclTrace.c28
2 files changed, 19 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 2e4a2c2..d474bf4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2005-11-01 Don Porter <dgp@users.sourceforge.net>
+ * generic/tclTrace.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/unixNotfy.test (1.1,2): Update error message whitespace to
match changes in code.
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index 6976a06..db9f892 100644
--- a/generic/tclTrace.c
+++ b/generic/tclTrace.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclTrace.c,v 1.27 2005/10/29 19:16:32 msofer Exp $
+ * RCS: @(#) $Id: tclTrace.c,v 1.28 2005/11/01 20:17:10 dgp Exp $
*/
#include "tclInt.h"
@@ -1426,18 +1426,20 @@ TclCheckExecutionTraces(interp, command, numChars, cmdPtr, code, traceFlags,
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++;
- if (state == NULL) {
- state = Tcl_SaveInterpState(interp, code);
- }
- traceCode = TraceExecutionProc((ClientData)tcmdPtr, interp,
- curLevel, command, (Tcl_Command)cmdPtr, objc, objv);
- 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++;
+ if (state == NULL) {
+ state = Tcl_SaveInterpState(interp, code);
+ }
+ traceCode = TraceExecutionProc((ClientData)tcmdPtr, interp,
+ curLevel, command, (Tcl_Command)cmdPtr, objc, objv);
+ if ((--tcmdPtr->refCount) <= 0) {
+ ckfree((char*)tcmdPtr);
+ }
}
}
if (active.nextTracePtr) {