diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2008-09-05 01:19:55 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2008-09-05 01:19:55 (GMT) |
commit | eab20b1515b9e3c6dfa404b57482ef34429d1a63 (patch) | |
tree | a6ff94ecc4d59a29e56cf7e3c05015b3e5b3294c /generic/tclTrace.c | |
parent | dc278b028d2f80dcc48ee9cb4273d863d995bbae (diff) | |
download | tcl-eab20b1515b9e3c6dfa404b57482ef34429d1a63.zip tcl-eab20b1515b9e3c6dfa404b57482ef34429d1a63.tar.gz tcl-eab20b1515b9e3c6dfa404b57482ef34429d1a63.tar.bz2 |
* generic/tclTrace.test (TraceVarProc):
* generic/unsupported.test: insure that unset traces are run even
when the coroutine is unwinding [Bug 2093947]
Diffstat (limited to 'generic/tclTrace.c')
-rw-r--r-- | generic/tclTrace.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/generic/tclTrace.c b/generic/tclTrace.c index bb4dbfa..8f095b5 100644 --- a/generic/tclTrace.c +++ b/generic/tclTrace.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclTrace.c,v 1.50 2008/08/07 22:29:09 nijtmans Exp $ + * RCS: @(#) $Id: tclTrace.c,v 1.51 2008/09/05 01:20:00 msofer Exp $ */ #include "tclInt.h" @@ -1947,7 +1947,8 @@ TraceVarProc( char *result; int code, destroy = 0; Tcl_DString cmd; - + int rewind = ((Interp *)interp)->execEnvPtr->rewind; + /* * We might call Tcl_Eval() below, and that might evaluate [trace vdelete] * which might try to free tvarPtr. We want to use tvarPtr until the end @@ -2008,8 +2009,20 @@ TraceVarProc( destroy = 1; tvarPtr->flags |= TCL_TRACE_DESTROYED; } + + /* + * Make sure that unset traces are rune even if the execEnv is + * rewinding (coroutine deletion, [Bug 2093947] + */ + + if (rewind && (flags & TCL_TRACE_UNSETS)) { + ((Interp *)interp)->execEnvPtr->rewind = 0; + } code = Tcl_EvalEx(interp, Tcl_DStringValue(&cmd), Tcl_DStringLength(&cmd), 0); + if (rewind) { + ((Interp *)interp)->execEnvPtr->rewind = rewind; + } if (code != TCL_OK) { /* copy error msg to result */ Tcl_Obj *errMsgObj = Tcl_GetObjResult(interp); Tcl_IncrRefCount(errMsgObj); |