summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-11-14 16:45:10 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-11-14 16:45:10 (GMT)
commit0c7c2c6991c1b97f1d18378f9fd9ae4ff04fc37b (patch)
treee1c49c3bf3372ba440c11250775d3bfb0090a5bb /generic
parenta951278c386a8485715fdb0c48f325ded815eb97 (diff)
downloadtcl-0c7c2c6991c1b97f1d18378f9fd9ae4ff04fc37b.zip
tcl-0c7c2c6991c1b97f1d18378f9fd9ae4ff04fc37b.tar.gz
tcl-0c7c2c6991c1b97f1d18378f9fd9ae4ff04fc37b.tar.bz2
* generic/tclBasic.c (CallCommandTraces): Save/restore the
interp result during traces to fix [Bug 1355342].
Diffstat (limited to 'generic')
-rw-r--r--generic/tclBasic.c10
1 files changed, 9 insertions, 1 deletions
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.
*/