summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmds.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2001-12-11 14:29:39 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2001-12-11 14:29:39 (GMT)
commitdd1a92bd5aff575da91fd60c31a16bc6f8f16b68 (patch)
tree1e0d41feac520041a88004e8c9a568fafad25db3 /generic/tclCompCmds.c
parenta331ce2d727b1e7f577c49077938f7fb26f4d084 (diff)
downloadtcl-dd1a92bd5aff575da91fd60c31a16bc6f8f16b68.zip
tcl-dd1a92bd5aff575da91fd60c31a16bc6f8f16b68.tar.gz
tcl-dd1a92bd5aff575da91fd60c31a16bc6f8f16b68.tar.bz2
removed overestimates of necessary stack depth for bytecodes in the
fix for [Bug 483611].
Diffstat (limited to 'generic/tclCompCmds.c')
-rw-r--r--generic/tclCompCmds.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index c94aeff..5ed7be0 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.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: tclCompCmds.c,v 1.17 2001/12/10 15:44:34 msofer Exp $
+ * RCS: @(#) $Id: tclCompCmds.c,v 1.18 2001/12/11 14:29:40 msofer Exp $
*/
#include "tclInt.h"
@@ -1808,7 +1808,14 @@ TclCompileLindexCmd(interp, parsePtr, envPtr)
if ( numWords == 3 ) {
TclEmitOpcode( INST_LIST_INDEX, envPtr );
} else {
- TclEmitInstInt4( INST_LIST_INDEX_MULTI, numWords-2, envPtr );
+ /*
+ * envPtr->currStackDepth has to be updated, as this instruction
+ * does not conform to the convention that its stack balance is
+ * (1-opnd): it is actually one less (-opnd).
+ */
+
+ TclEmitInstInt4( INST_LIST_INDEX_MULTI, numWords-2, envPtr );
+ envPtr->currStackDepth--;
}
return TCL_OK;