diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2008-09-17 00:01:44 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2008-09-17 00:01:44 (GMT) |
commit | aeeead96a33d9d54f77f6beaa6e10b1bd2a8dd4f (patch) | |
tree | b15861125f391af1b27fed45a53869e37d94b7c9 | |
parent | 3b797b51b1cb45323e31deb42e2f9f95d0c877c0 (diff) | |
download | tcl-aeeead96a33d9d54f77f6beaa6e10b1bd2a8dd4f.zip tcl-aeeead96a33d9d54f77f6beaa6e10b1bd2a8dd4f.tar.gz tcl-aeeead96a33d9d54f77f6beaa6e10b1bd2a8dd4f.tar.bz2 |
* generic/tclBasic.c: move TclResetCancellation to be called on
returning to level 0, as opposed to it being called on starting a
command at level 0. Add a call on returning via Tcl_EvalObjEx to
fix [Bug 2114165].
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | generic/tclBasic.c | 18 |
2 files changed, 23 insertions, 2 deletions
@@ -1,3 +1,10 @@ +2008-09-16 Miguel Sofer <msofer@users.sf.net> + + * generic/tclBasic.c: move TclResetCancellation to be called on + returning to level 0, as opposed to it being called on starting a + command at level 0. Add a call on returning via Tcl_EvalObjEx to + fix [Bug 2114165]. + 2008-09-10 Donal K. Fellows <dkf@users.sf.net> * doc/binary.n: Added partial documentation of [binary encode] and diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 1f80d43..42cac49 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -16,7 +16,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.366 2008/09/10 13:24:00 msofer Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.367 2008/09/17 00:01:48 msofer Exp $ */ #include "tclInt.h" @@ -4033,7 +4033,6 @@ TclNREvalObjv( TclNRAddCallback(interp, NRCommand, NULL, NULL, NULL, NULL); cmdPtrPtr = (Command **) &(TOP_CB(interp)->data[0]); - TclResetCancellation(interp, 0); iPtr->numLevels++; result = TclInterpReady(interp); @@ -4411,6 +4410,14 @@ TEOV_Exception( result = TCL_ERROR; } } + + /* + * We are returning to level 0, so should process TclResetCancellation. As + * numLevels has not *yet* been decreased, do not call it: do the thing + * here directly. + */ + + iPtr->flags &= (~(CANCELED | TCL_CANCEL_UNWIND)); return result; } @@ -5924,6 +5931,13 @@ TEOEx_ByteCodeCallback( script = Tcl_GetStringFromObj(objPtr, &numSrcBytes); Tcl_LogCommandInfo(interp, script, script, numSrcBytes); } + + /* + * We are returning to level 0, so should call TclResetCancellation. + * Let us just unset the flags inline. + */ + + iPtr->flags &= (~(CANCELED | TCL_CANCEL_UNWIND)); } iPtr->evalFlags = 0; |