summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2003-09-24 02:17:09 (GMT)
committerdgp <dgp@users.sourceforge.net>2003-09-24 02:17:09 (GMT)
commitb5d80dadf08263e6780d1038b46fdbb4eaa4829c (patch)
tree39da8d892b5c4660498cff95945920fe451cacbf /generic
parentc9ac0de4ba3254bc18fb2222cf61c5e40813fd97 (diff)
downloadtcl-b5d80dadf08263e6780d1038b46fdbb4eaa4829c.zip
tcl-b5d80dadf08263e6780d1038b46fdbb4eaa4829c.tar.gz
tcl-b5d80dadf08263e6780d1038b46fdbb4eaa4829c.tar.bz2
* generic/tclCmdMZ.c (): Fixed [Bug 807243] where
* tests/trace.test (trace-31,32.*): the introspection results of both [trace info command] and [trace info execution] were getting co-mingled. Thanks to Mark Saye for the report.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCmdMZ.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index ca1abef..a3dc03a 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.6 2003/07/16 08:24:20 dkf Exp $
+ * RCS: @(#) $Id: tclCmdMZ.c,v 1.82.2.7 2003/09/24 02:17:10 dgp Exp $
*/
#include "tclInt.h"
@@ -3350,6 +3350,7 @@ TclTraceExecutionObjCmd(interp, optionIndex, objc, objv)
resultListPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
while ((clientData = Tcl_CommandTraceInfo(interp, name, 0,
TraceCommandProc, clientData)) != NULL) {
+ int numOps = 0;
TraceCommandInfo *tcmdPtr = (TraceCommandInfo *) clientData;
@@ -3363,6 +3364,7 @@ TclTraceExecutionObjCmd(interp, optionIndex, objc, objv)
*/
elemObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
+ Tcl_IncrRefCount(elemObjPtr);
if (tcmdPtr->flags & TCL_TRACE_ENTER_EXEC) {
Tcl_ListObjAppendElement(NULL, elemObjPtr,
Tcl_NewStringObj("enter",5));
@@ -3379,7 +3381,13 @@ TclTraceExecutionObjCmd(interp, optionIndex, objc, objv)
Tcl_ListObjAppendElement(NULL, elemObjPtr,
Tcl_NewStringObj("leavestep",9));
}
+ Tcl_ListObjLength(NULL, elemObjPtr, &numOps);
+ if (0 == numOps) {
+ Tcl_DecrRefCount(elemObjPtr);
+ continue;
+ }
Tcl_ListObjAppendElement(NULL, eachTraceObjPtr, elemObjPtr);
+ Tcl_DecrRefCount(elemObjPtr);
elemObjPtr = NULL;
Tcl_ListObjAppendElement(NULL, eachTraceObjPtr,
@@ -3545,6 +3553,7 @@ TclTraceCommandObjCmd(interp, optionIndex, objc, objv)
resultListPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
while ((clientData = Tcl_CommandTraceInfo(interp, name, 0,
TraceCommandProc, clientData)) != NULL) {
+ int numOps = 0;
TraceCommandInfo *tcmdPtr = (TraceCommandInfo *) clientData;
@@ -3558,6 +3567,7 @@ TclTraceCommandObjCmd(interp, optionIndex, objc, objv)
*/
elemObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
+ Tcl_IncrRefCount(elemObjPtr);
if (tcmdPtr->flags & TCL_TRACE_RENAME) {
Tcl_ListObjAppendElement(NULL, elemObjPtr,
Tcl_NewStringObj("rename",6));
@@ -3566,7 +3576,13 @@ TclTraceCommandObjCmd(interp, optionIndex, objc, objv)
Tcl_ListObjAppendElement(NULL, elemObjPtr,
Tcl_NewStringObj("delete",6));
}
+ Tcl_ListObjLength(NULL, elemObjPtr, &numOps);
+ if (0 == numOps) {
+ Tcl_DecrRefCount(elemObjPtr);
+ continue;
+ }
Tcl_ListObjAppendElement(NULL, eachTraceObjPtr, elemObjPtr);
+ Tcl_DecrRefCount(elemObjPtr);
elemObjPtr = Tcl_NewStringObj(tcmdPtr->command, -1);
Tcl_ListObjAppendElement(NULL, eachTraceObjPtr, elemObjPtr);