diff options
Diffstat (limited to 'generic/tclCmdIL.c')
-rw-r--r-- | generic/tclCmdIL.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 6c9a623..5ff71a5 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.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: tclCmdIL.c,v 1.184 2010/08/22 18:53:26 nijtmans Exp $ + * RCS: @(#) $Id: tclCmdIL.c,v 1.185 2010/09/27 19:42:38 msofer Exp $ */ #include "tclInt.h" @@ -1155,11 +1155,22 @@ InfoFrameCmd( if (iPtr->execEnvPtr->corPtr) { /* - * A coroutine: must fix the level computations + * A coroutine: must fix the level computations AND the cmdFrame chain, + * which is interrupted at the base. */ - topLevel += iPtr->execEnvPtr->corPtr->caller.cmdFramePtr->level - - iPtr->execEnvPtr->corPtr->base.cmdFramePtr->level; + CoroutineData *corPtr = iPtr->execEnvPtr->corPtr; + CmdFrame *runPtr = iPtr->cmdFramePtr; + CmdFrame *lastPtr = NULL; + + topLevel += corPtr->caller.cmdFramePtr->level; + while (runPtr && (runPtr != corPtr->caller.cmdFramePtr)) { + lastPtr = runPtr; + runPtr = runPtr->nextPtr; + } + if (lastPtr && !runPtr) { + lastPtr->nextPtr = corPtr->caller.cmdFramePtr; + } } if (objc == 1) { |