diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2001-12-10 15:44:34 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2001-12-10 15:44:34 (GMT) |
commit | 22f99d42b260461aacb728ca3326315bd4eb2041 (patch) | |
tree | 3537073577782a6683cee13a0a237de6e91a0e33 /generic/tclProc.c | |
parent | 2cbac63a7dc061dc68347e297b82609c9802bb95 (diff) | |
download | tcl-22f99d42b260461aacb728ca3326315bd4eb2041.zip tcl-22f99d42b260461aacb728ca3326315bd4eb2041.tar.gz tcl-22f99d42b260461aacb728ca3326315bd4eb2041.tar.bz2 |
fixed the calculation of the maximal stack depth required by bytecodes [Bug 483611].
Diffstat (limited to 'generic/tclProc.c')
-rw-r--r-- | generic/tclProc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/generic/tclProc.c b/generic/tclProc.c index 21cba70..f73f8a7 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.34 2001/11/27 13:47:29 dkf Exp $ + * RCS: @(#) $Id: tclProc.c,v 1.35 2001/12/10 15:44:34 msofer Exp $ */ #include "tclInt.h" @@ -1656,9 +1656,6 @@ ProcBodyUpdateString(objPtr) * Results: * The return value is TCL_OK, indicating successful compilation. * - * envPtr->maxStackDepth is updated with the maximum number of stack - * elements needed to execute the command. - * * Side effects: * Instructions are added to envPtr to execute a noOp at runtime. * @@ -1674,11 +1671,13 @@ TclCompileNoOp(interp, parsePtr, envPtr) { Tcl_Token *tokenPtr; int i, code; + int savedStackDepth = envPtr->currStackDepth; - envPtr->maxStackDepth = 1; tokenPtr = parsePtr->tokenPtr; for(i = 1; i < parsePtr->numWords; i++) { tokenPtr = tokenPtr + tokenPtr->numComponents + 1; + envPtr->currStackDepth = savedStackDepth; + if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD) { code = TclCompileTokens(interp, tokenPtr+1, tokenPtr->numComponents, envPtr); @@ -1688,6 +1687,7 @@ TclCompileNoOp(interp, parsePtr, envPtr) TclEmitOpcode(INST_POP, envPtr); } } + envPtr->currStackDepth = savedStackDepth; TclEmitPush(TclRegisterLiteral(envPtr, "", 0, /*onHeap*/ 0), envPtr); return TCL_OK; } |