diff options
author | dgp <dgp@users.sourceforge.net> | 2005-11-14 16:45:10 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2005-11-14 16:45:10 (GMT) |
commit | 0c7c2c6991c1b97f1d18378f9fd9ae4ff04fc37b (patch) | |
tree | e1c49c3bf3372ba440c11250775d3bfb0090a5bb | |
parent | a951278c386a8485715fdb0c48f325ded815eb97 (diff) | |
download | tcl-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].
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclBasic.c | 10 |
2 files changed, 14 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2005-11-14 Don Porter <dgp@users.sourceforge.net> + + * generic/tclBasic.c (CallCommandTraces): Save/restore the + interp result during traces to fix [Bug 1355342]. + 2005-11-13 Miguel Sofer <msofer@users.sf.net> * 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. */ |