diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2009-12-10 16:54:00 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2009-12-10 16:54:00 (GMT) |
commit | 5d16655f0b3f57cc706cdc882ed7d0d5edd9c14b (patch) | |
tree | 3468a33458205a5cefa3cf3a41d02627d7a6439d /generic/tclExecute.c | |
parent | b3dcb75ee899428c0b1fae1ae3ddc2770030792b (diff) | |
download | tcl-5d16655f0b3f57cc706cdc882ed7d0d5edd9c14b.zip tcl-5d16655f0b3f57cc706cdc882ed7d0d5edd9c14b.tar.gz tcl-5d16655f0b3f57cc706cdc882ed7d0d5edd9c14b.tar.bz2 |
* generic/tclBasic.c: Reducing the # of moving parts for
* generic/tclExecute.c: coroutines
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 3fac4ea..9597075 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.458 2009/12/09 17:55:01 msofer Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.459 2009/12/10 16:54:01 msofer Exp $ */ #include "tclInt.h" @@ -1972,20 +1972,21 @@ TclExecuteByteCode( * execution stack is large enough to execute this ByteCode. */ - if (!codePtr) { resumeCoroutine: + if (!codePtr) { + CoroutineData *corPtr = iPtr->execEnvPtr->corPtr; /* * Reawakening a suspended coroutine: the [yield] command is * returning. */ - NRE_ASSERT(iPtr->execEnvPtr->corPtr->eePtr == iPtr->execEnvPtr); - NRE_ASSERT(iPtr->execEnvPtr->corPtr != NULL); - NRE_ASSERT(iPtr->execEnvPtr->corPtr->eePtr == iPtr->execEnvPtr); - NRE_ASSERT(COR_IS_SUSPENDED(iPtr->execEnvPtr->corPtr)); + NRE_ASSERT(corPtr != NULL); + NRE_ASSERT(corPtr->eePtr == iPtr->execEnvPtr); + NRE_ASSERT(COR_IS_SUSPENDED(corPtr)); OBP = iPtr->execEnvPtr->bottomPtr; - iPtr->execEnvPtr->corPtr->stackLevel = &TAUX; + corPtr->stackLevel = &TAUX; + corPtr->base.cmdFramePtr->nextPtr = corPtr->caller.cmdFramePtr; if (iPtr->execEnvPtr->rewind) { TRESULT = TCL_ERROR; } @@ -2835,7 +2836,8 @@ TclExecuteByteCode( goto nonRecursiveCallStart; } else { CoroutineData *corPtr = iPtr->execEnvPtr->corPtr; - + + codePtr = NULL; corPtr->callerBP = BP; goto resumeCoroutine; } |