summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-03-24 01:14:11 (GMT)
committerhobbs <hobbs>2001-03-24 01:14:11 (GMT)
commitf8feaac0e09de7912576461ebbbe8c78b8c42ead (patch)
treec84c0a016d17edbbe787bc3f13577f905b0ac9c6 /generic
parent90cecf4cb456a5a3e2f06ec313d9e7f649d3d7d2 (diff)
downloadtcl-f8feaac0e09de7912576461ebbbe8c78b8c42ead.zip
tcl-f8feaac0e09de7912576461ebbbe8c78b8c42ead.tar.gz
tcl-f8feaac0e09de7912576461ebbbe8c78b8c42ead.tar.bz2
* generic/tclVar.c (Tcl_ArrayObjCmd): Corrected retrieval of
resultPtr to prevent possible corruption.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclVar.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c
index bba5e4f..73e2fcd 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.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: tclVar.c,v 1.29 2001/03/13 11:18:48 dkf Exp $
+ * RCS: @(#) $Id: tclVar.c,v 1.30 2001/03/24 01:14:11 hobbs Exp $
*/
#include "tclInt.h"
@@ -2915,7 +2915,7 @@ Tcl_ArrayObjCmd(dummy, interp, objc, objv)
Interp *iPtr = (Interp *) interp;
Var *varPtr, *arrayPtr;
Tcl_HashEntry *hPtr;
- Tcl_Obj *resultPtr = Tcl_GetObjResult(interp);
+ Tcl_Obj *resultPtr;
int notArray;
char *varName, *msg;
int index, result;
@@ -2961,6 +2961,13 @@ Tcl_ArrayObjCmd(dummy, interp, objc, objv)
}
}
+ /*
+ * We have to wait to get the resultPtr until here because
+ * CallTraces can affect the result.
+ */
+
+ resultPtr = Tcl_GetObjResult(interp);
+
switch (index) {
case ARRAY_ANYMORE: {
ArraySearch *searchPtr;