summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2009-12-08 22:58:11 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2009-12-08 22:58:11 (GMT)
commit241690109568a5350f8d8c672078b281fc19413b (patch)
treefbe46a4963e40cc06b66a8c9c84d52a911f17e1b /generic/tclBasic.c
parent8c26b3a75b9dd2609485169cd288ca77926bd8d6 (diff)
downloadtcl-241690109568a5350f8d8c672078b281fc19413b.zip
tcl-241690109568a5350f8d8c672078b281fc19413b.tar.gz
tcl-241690109568a5350f8d8c672078b281fc19413b.tar.bz2
minor cleanup
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 072dfe3..5f30f0d 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.419 2009/12/08 21:44:56 msofer Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.420 2009/12/08 22:58:11 msofer Exp $
*/
#include "tclInt.h"
@@ -8665,7 +8665,6 @@ NRCoroutineExitCallback(
TclDeleteExecEnv(corPtr->eePtr);
corPtr->eePtr = NULL;
- SAVE_CONTEXT(corPtr->running);
RESTORE_CONTEXT(corPtr->caller);
NRE_ASSERT(iPtr->framePtr == corPtr->caller.framePtr);
@@ -8798,10 +8797,6 @@ TclNRCoroutineObjCmd(
corPtr->stackLevel = NULL;
corPtr->callerBP = NULL;
- /*
- * On first run just set a 0 level-offset, the natural numbering is
- * correct. The offset will be fixed for later runs.
- */
Tcl_DStringInit(&ds);
if (nsPtr != iPtr->globalNsPtr) {
@@ -8850,14 +8845,16 @@ TclNRCoroutineObjCmd(
framePtr->objc = objc-2;
framePtr->objv = &objv[2];
- SAVE_CONTEXT(corPtr->base);
- corPtr->running = NULL_CONTEXT;
-
/*
- * Signal TEBC that it has to initialize the base cmdFramePtr.
+ * Save the base context. The base cmdFramePtr is unknown at this time: it
+ * will be allocated in the Tcl stack. So signal TEBC that it has to
+ * initialize the base cmdFramePtr by setting it to NULL.
*/
+ SAVE_CONTEXT(corPtr->base);
corPtr->base.cmdFramePtr = NULL;
+ corPtr->running = NULL_CONTEXT;
+
/*
* #280.