From 0c7c2c6991c1b97f1d18378f9fd9ae4ff04fc37b Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 14 Nov 2005 16:45:10 +0000 Subject: * generic/tclBasic.c (CallCommandTraces): Save/restore the interp result during traces to fix [Bug 1355342]. --- ChangeLog | 5 +++++ generic/tclBasic.c | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bd6dedb..f29a2d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-14 Don Porter + + * generic/tclBasic.c (CallCommandTraces): Save/restore the + interp result during traces to fix [Bug 1355342]. + 2005-11-13 Miguel Sofer * generic/tclInt.h: diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 6fc9dd3..c5c842d 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.181 2005/11/13 01:38:15 msofer Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.182 2005/11/14 16:45:11 dgp Exp $ */ #include "tclInt.h" @@ -2612,6 +2612,7 @@ CallCommandTraces( ActiveCommandTrace active; char *result; Tcl_Obj *oldNamePtr = NULL; + Tcl_InterpState state = NULL; if (cmdPtr->flags & CMD_TRACE_ACTIVE) { /* @@ -2662,6 +2663,9 @@ CallCommandTraces( oldName = TclGetString(oldNamePtr); } tracePtr->refCount++; + if (state == NULL) { + state = Tcl_SaveInterpState((Tcl_Interp *)iPtr, TCL_OK); + } (*tracePtr->traceProc)(tracePtr->clientData, (Tcl_Interp *) iPtr, oldName, newName, flags); cmdPtr->flags &= ~tracePtr->flags; @@ -2670,6 +2674,10 @@ CallCommandTraces( } } + if (state) { + Tcl_RestoreInterpState((Tcl_Interp *)iPtr, state); + } + /* * If a new object was created to hold the full oldName, free it now. */ -- cgit v0.12