diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2009-12-08 21:44:56 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2009-12-08 21:44:56 (GMT) |
commit | 8c26b3a75b9dd2609485169cd288ca77926bd8d6 (patch) | |
tree | 3d7346f879726d81a8fbb39c3e578ee435737adc /generic/tclExecute.c | |
parent | b475ec90cf97e4e17e2fda2954e1983c882ab339 (diff) | |
download | tcl-8c26b3a75b9dd2609485169cd288ca77926bd8d6.zip tcl-8c26b3a75b9dd2609485169cd288ca77926bd8d6.tar.gz tcl-8c26b3a75b9dd2609485169cd288ca77926bd8d6.tar.bz2 |
baby steps towards nre-enabling coroutine first run
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 039ad24..f54bb54 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.455 2009/12/08 20:56:29 msofer Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.456 2009/12/08 21:44:56 msofer Exp $ */ #include "tclInt.h" @@ -2031,9 +2031,19 @@ TclExecuteByteCode( bcFramePtr->cmd.str.cmd = NULL; bcFramePtr->cmd.str.len = 0; - if (iPtr->execEnvPtr->rewind) { - TRESULT = TCL_ERROR; - goto abnormalReturn; + if (iPtr->execEnvPtr->corPtr) { + if (!iPtr->execEnvPtr->corPtr->base.cmdFramePtr) { + /* + * First coroutine run, the base cmdFramePtr has not yet been + * initialized. Do it now. + */ + + iPtr->execEnvPtr->corPtr->base.cmdFramePtr = bcFramePtr; + } + if (iPtr->execEnvPtr->rewind) { + TRESULT = TCL_ERROR; + goto abnormalReturn; + } } #ifdef TCL_COMPILE_DEBUG |