diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2008-08-21 21:24:53 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2008-08-21 21:24:53 (GMT) |
commit | 3665ead9e176eb4b5058f87e048c67ea3efb3dd3 (patch) | |
tree | dfbcedb7d9769b0166e6008e0ed7ae50fdeb6efc /generic | |
parent | d9990b25f1fc6db099c55ae7ce637230bc41d02c (diff) | |
download | tcl-3665ead9e176eb4b5058f87e048c67ea3efb3dd3.zip tcl-3665ead9e176eb4b5058f87e048c67ea3efb3dd3.tar.gz tcl-3665ead9e176eb4b5058f87e048c67ea3efb3dd3.tar.bz2 |
parts of last commit were not saved :}
Diffstat (limited to 'generic')
-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 7e4973b..d6d0b09 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.149 2008/08/21 21:01:25 msofer Exp $ + * RCS: @(#) $Id: tclCmdIL.c,v 1.150 2008/08/21 21:24:53 msofer Exp $ */ #include "tclInt.h" @@ -1045,7 +1045,9 @@ InfoFrameCmd( Interp *iPtr = (Interp *) interp; int level; CmdFrame *framePtr; - int absoluteLevel = iPtr->cmdFramePtr->level; + int absoluteLevel = ((iPtr->cmdFramePtr == NULL) + ? 0 + : iPtr->cmdFramePtr->level); if (iPtr->execEnvPtr->corPtr) { /* @@ -1062,7 +1064,7 @@ InfoFrameCmd( */ int levels = - (iPtr->cmdFramePtr == NULL ? 0 : iPtr->cmdFramePtr->level); + (iPtr->cmdFramePtr == NULL ? 0 : absoluteLevel); Tcl_SetObjResult(interp, Tcl_NewIntObj (levels)); return TCL_OK; @@ -1100,7 +1102,16 @@ InfoFrameCmd( for (framePtr = iPtr->cmdFramePtr; framePtr != NULL; framePtr = framePtr->nextPtr) { - if (framePtr->level == level) { + absoluteLevel = framePtr->level; + if (iPtr->execEnvPtr->corPtr) { + /* + * We are running within a coroutine, the levels are relative to + * the coroutine's initial frame: do the correction here. + */ + + absoluteLevel += iPtr->execEnvPtr->corPtr->levelOffset; + } + if (absoluteLevel == level) { break; } } |