summaryrefslogtreecommitdiffstats
path: root/generic/tclIndexObj.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2004-10-06 14:59:00 (GMT)
committerdgp <dgp@users.sourceforge.net>2004-10-06 14:59:00 (GMT)
commit604e737b0d1ae40d2f45da85bb5dd7cbf096cad7 (patch)
tree71a0e0114969e45230d047cb6fb0374e8f243c37 /generic/tclIndexObj.c
parente6efab5e75a4359cf171db3cde79672fd14ecfbc (diff)
downloadtcl-604e737b0d1ae40d2f45da85bb5dd7cbf096cad7.zip
tcl-604e737b0d1ae40d2f45da85bb5dd7cbf096cad7.tar.gz
tcl-604e737b0d1ae40d2f45da85bb5dd7cbf096cad7.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: 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/tclIndexObj.c')
-rw-r--r--generic/tclIndexObj.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c
index f752a91..22397af 100644
--- a/generic/tclIndexObj.c
+++ b/generic/tclIndexObj.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIndexObj.c,v 1.19 2004/09/29 22:17:31 dkf Exp $
+ * RCS: @(#) $Id: tclIndexObj.c,v 1.20 2004/10/06 14:59:02 dgp Exp $
*/
#include "tclInt.h"
@@ -314,9 +314,9 @@ SetIndexFromAny(interp, objPtr)
Tcl_Interp *interp; /* Used for error reporting if not NULL. */
register Tcl_Obj *objPtr; /* The object to convert. */
{
- Tcl_AppendToObj(Tcl_GetObjResult(interp),
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(
"can't convert value to index except via Tcl_GetIndexFromObj API",
- -1);
+ -1));
return TCL_ERROR;
}