summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2008-08-07 04:13:49 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2008-08-07 04:13:49 (GMT)
commit62d36886b926591b14c230558c64c8ccc85cbb82 (patch)
tree26cfbd7a3f089a2bb3f53d5644eede7418f4f529 /generic/tclExecute.c
parent4c3c492b67b48506cdf77c1f146af9f4318f24c1 (diff)
downloadtcl-62d36886b926591b14c230558c64c8ccc85cbb82.zip
tcl-62d36886b926591b14c230558c64c8ccc85cbb82.tar.gz
tcl-62d36886b926591b14c230558c64c8ccc85cbb82.tar.bz2
* generic/tclBasic.c: Fix tailcalls falling out of tebc into
* generic/tclExecute.c: Tcl_EvalEx [Bug 2017946] * generic/tclInt.h:
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 87695ba..614a3d9 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclExecute.c,v 1.398 2008/08/05 15:52:23 msofer Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.399 2008/08/07 04:13:51 msofer Exp $
*/
#include "tclInt.h"
@@ -7832,20 +7832,18 @@ TclExecuteByteCode(
NRE_ASSERT(lastPtr->nextPtr == NULL);
if (!isTailcall) {
/* save the interp state, arrange for restoring it after
- running the callbacks.*/
+ running the callbacks. Put the callback at the bottom of the
+ atExit stack */
Tcl_InterpState state = Tcl_SaveInterpState(interp, result);
TclNRAddCallback(interp, NRRestoreInterpState, state, NULL,
NULL, NULL);
+ lastPtr->nextPtr = TOP_CB(iPtr);
+ TOP_CB(iPtr) = TOP_CB(iPtr)->nextPtr;
+ lastPtr->nextPtr->nextPtr = NULL;
}
-
- /*
- * splice in the atExit callbacks and rerun all callbacks
- */
-
- lastPtr->nextPtr = TOP_CB(interp);
- TOP_CB(interp) = atExitPtr;
+ iPtr->atExitPtr = atExitPtr;
}
return result;