diff options
author | dgp <dgp@users.sourceforge.net> | 2004-10-06 15:59:22 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2004-10-06 15:59:22 (GMT) |
commit | b0e29724338467351f10a4b11e317a5866ac658f (patch) | |
tree | d861bb4c44fd414c034f6faa23c736648d498e29 /generic/tclTrace.c | |
parent | a57d7ac68eaafc7de2e3f9d05a148384f3716f52 (diff) | |
download | tcl-b0e29724338467351f10a4b11e317a5866ac658f.zip tcl-b0e29724338467351f10a4b11e317a5866ac658f.tar.gz tcl-b0e29724338467351f10a4b11e317a5866ac658f.tar.bz2 |
* generic/tclBasic.c:
* generic/tclBinary.c:
* generic/tclCmdAH.c:
* generic/tclCmdIL.c:
* generic/tclCmdMZ.c:
* generic/tclCompExpr.c:
* generic/tclDictObj.c:
* generic/tclEncoding.c:
* generic/tclExecute.c:
* generic/tclFCmd.c:
* generic/tclHistory.c:
* generic/tclIndexObj.c:
* generic/tclInterp.c:
* generic/tclIO.c:
* generic/tclIOCmd.c:
* generic/tclNamesp.c:
* generic/tclObj.c:
* generic/tclPkg.c:
* generic/tclResult.c:
* generic/tclScan.c:
* generic/tclTimer.c:
* generic/tclTrace.c:
* generic/tclUtil.c:
* generic/tclVar.c:
It is a poor practice to directly set or append to the value
of the objResult of an interp, because that value might be
shared, and in that circumstance a Tcl_Panic() will be the
result. Searched for example of this practice and replaced
with safer alternatives, often using the Tcl_AppendResult()
routine that dkf just rehabilitated.
Diffstat (limited to 'generic/tclTrace.c')
-rw-r--r-- | generic/tclTrace.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclTrace.c b/generic/tclTrace.c index dc8cbd3..2b0f10f 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.14 2004/10/05 18:14:28 dgp Exp $ + * RCS: @(#) $Id: tclTrace.c,v 1.15 2004/10/06 15:59:25 dgp Exp $ */ #include "tclInt.h" @@ -356,7 +356,7 @@ Tcl_TraceObjCmd(dummy, interp, objc, objv) Tcl_WrongNumArgs(interp, 2, objv, "name"); return TCL_ERROR; } - resultListPtr = Tcl_GetObjResult(interp); + resultListPtr = Tcl_NewObj(); clientData = 0; name = Tcl_GetString(objv[2]); while ((clientData = Tcl_VarTraceInfo(interp, name, 0, @@ -978,7 +978,7 @@ TclTraceVariableObjCmd(interp, optionIndex, objc, objv) return TCL_ERROR; } - resultListPtr = Tcl_GetObjResult(interp); + resultListPtr = Tcl_NewObj(); clientData = 0; name = Tcl_GetString(objv[3]); while ((clientData = Tcl_VarTraceInfo(interp, name, 0, @@ -1995,7 +1995,7 @@ TraceVarProc(clientData, interp, name1, name2, flags) code = Tcl_EvalEx(interp, Tcl_DStringValue(&cmd), Tcl_DStringLength(&cmd), 0); if (code != TCL_OK) { /* copy error msg to result */ - register Tcl_Obj *errMsgObj = Tcl_GetObjResult(interp); + Tcl_Obj *errMsgObj = Tcl_GetObjResult(interp); Tcl_IncrRefCount(errMsgObj); result = (char *) errMsgObj; } |