diff options
Diffstat (limited to 'generic/tclProc.c')
-rw-r--r-- | generic/tclProc.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/generic/tclProc.c b/generic/tclProc.c index c20096e..7d269a6 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclProc.c,v 1.31 2001/10/15 22:25:45 msofer Exp $ + * RCS: @(#) $Id: tclProc.c,v 1.32 2001/11/16 20:01:04 msofer Exp $ */ #include "tclInt.h" @@ -1069,9 +1069,18 @@ TclObjInterpProc(clientData, interp, objc, objv) } #endif /*TCL_COMPILE_DEBUG*/ + /* + * Tcl_EvalObjEx will increase the level count again while evaluating + * the body, resulting in a total level increase of 2; correct this + * behaviour before evaling the body, restore afterwards. + */ + + iPtr->numLevels--; + iPtr->returnCode = TCL_OK; procPtr->refCount++; result = Tcl_EvalObjEx(interp, procPtr->bodyPtr, 0); + iPtr->numLevels++; procPtr->refCount--; if (procPtr->refCount <= 0) { TclProcCleanupProc(procPtr); |