summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authormsofer <msofer@noemail.net>2009-12-10 23:52:29 (GMT)
committermsofer <msofer@noemail.net>2009-12-10 23:52:29 (GMT)
commit066149db6bbf99eada1b81b17ad77f8fe7fced84 (patch)
tree61bbed44f7eba044e2ef57f91291e166fd7be2b7 /generic
parent71c7234b37c6bb26a2a73f1bf2d88779ef59cac9 (diff)
downloadtcl-066149db6bbf99eada1b81b17ad77f8fe7fced84.zip
tcl-066149db6bbf99eada1b81b17ad77f8fe7fced84.tar.gz
tcl-066149db6bbf99eada1b81b17ad77f8fe7fced84.tar.bz2
* generic/tclBasic.c: Full nre-enabling of coroutines
* generic/tclExecute.c: [Bug 2806407] FossilOrigin-Name: 9995f661beb404599f850e8fb305997219eb900b
Diffstat (limited to 'generic')
-rw-r--r--generic/tclBasic.c13
-rw-r--r--generic/tclExecute.c10
2 files changed, 7 insertions, 16 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index d4f905d..d8a449b 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.428 2009/12/10 22:38:52 msofer Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.429 2009/12/10 23:52:30 msofer Exp $
*/
#include "tclInt.h"
@@ -8736,7 +8736,6 @@ TclNRCoroutineObjCmd(
Command *cmdPtr;
CoroutineData *corPtr;
Tcl_Obj *cmdObjPtr;
- TEOV_callback *rootPtr = TOP_CB(interp);
const char *fullName;
const char *procName;
Namespace *nsPtr, *altNsPtr, *cxtNsPtr;
@@ -8849,7 +8848,6 @@ TclNRCoroutineObjCmd(
* initialize the base cmdFramePtr by setting it to NULL.
*/
- SAVE_CONTEXT(corPtr->base);
corPtr->base.cmdFramePtr = NULL;
corPtr->running = NULL_CONTEXT;
corPtr->stackLevel = NULL;
@@ -8884,14 +8882,7 @@ TclNRCoroutineObjCmd(
iPtr->evalFlags |= TCL_EVAL_REDIRECT;
TclNREvalObjEx(interp, cmdObjPtr, 0, NULL, 0);
- /*
- * This should just be returning TCL_OK, to let the coro run in the
- * caller's TEBC instance if available. BUT this causes an error in
- * TclStackFree, couldn't yet find why. It is a bit of a mistery.
- * msofer, 2009-12-08
- */
-
- return TclNRRunCallbacks(interp, TCL_OK, rootPtr, 0);
+ return TCL_OK;
}
/*
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index e2ef7e4..f4a204e 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.461 2009/12/10 22:01:48 msofer Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.462 2009/12/10 23:52:30 msofer Exp $
*/
#include "tclInt.h"
@@ -2039,8 +2039,9 @@ TclExecuteByteCode(
*/
corPtr->base.cmdFramePtr = bcFramePtr;
- BP->prevBottomPtr = NULL;
iPtr->varFramePtr = iPtr->rootFramePtr;
+ corPtr->callerBP = BP->prevBottomPtr;
+ BP->prevBottomPtr = NULL;
}
if (!corPtr->stackLevel) {
@@ -2832,13 +2833,12 @@ TclExecuteByteCode(
* new one.
*/
- if (param) {
- codePtr = param;
+ codePtr = param;
+ if (codePtr) {
goto nonRecursiveCallStart;
} else {
CoroutineData *corPtr = iPtr->execEnvPtr->corPtr;
- codePtr = NULL;
corPtr->callerBP = BP;
goto resumeCoroutine;
}