summaryrefslogtreecommitdiffstats
path: root/generic/tclProc.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2001-11-16 20:01:04 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2001-11-16 20:01:04 (GMT)
commit39fcfea4a14df2f64af2f0b186157d5ec9c91030 (patch)
tree580baa5a7e9751093a2c83da278179e0781a1aa1 /generic/tclProc.c
parent92abf41d3582dceca104a6177d650952a41bdd87 (diff)
downloadtcl-39fcfea4a14df2f64af2f0b186157d5ec9c91030.zip
tcl-39fcfea4a14df2f64af2f0b186157d5ec9c91030.tar.gz
tcl-39fcfea4a14df2f64af2f0b186157d5ec9c91030.tar.bz2
Code reordering; execution levels made consistent [Bug 480896].
Diffstat (limited to 'generic/tclProc.c')
-rw-r--r--generic/tclProc.c11
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);