From f8feaac0e09de7912576461ebbbe8c78b8c42ead Mon Sep 17 00:00:00 2001 From: hobbs Date: Sat, 24 Mar 2001 01:14:11 +0000 Subject: * generic/tclVar.c (Tcl_ArrayObjCmd): Corrected retrieval of resultPtr to prevent possible corruption. --- generic/tclVar.c | 11 +++++++++-- 1 file 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; -- cgit v0.12