Attachment "validate.patch" to
ticket [483612ffff]
added by
msofer
2001-11-20 06:02:30.
Also attachment "validate.patch" to
ticket [483611ffff]
added by
msofer
2001-11-20 06:01:58.
Index: generic/tclExecute.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclExecute.c,v
retrieving revision 1.37
diff -u -r1.37 tclExecute.c
--- generic/tclExecute.c 2001/11/16 20:14:27 1.37
+++ generic/tclExecute.c 2001/11/19 22:58:41
@@ -261,8 +261,7 @@
static char * StringForResultCode _ANSI_ARGS_((int result));
static void ValidatePcAndStackTop _ANSI_ARGS_((
ByteCode *codePtr, unsigned char *pc,
- int stackTop, int stackLowerBound,
- int stackUpperBound));
+ int stackTop, int stackLowerBound));
#endif
static int VerifyExprObjType _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr));
@@ -588,8 +587,7 @@
for (;;) {
#ifdef TCL_COMPILE_DEBUG
- ValidatePcAndStackTop(codePtr, pc, stackTop, initStackTop,
- eePtr->stackEnd);
+ ValidatePcAndStackTop(codePtr, pc, stackTop, initStackTop);
if (traceInstructions) {
fprintf(stdout, "%2d: %2d ", iPtr->numLevels, stackTop);
TclPrintInstruction(codePtr, pc);
@@ -726,6 +724,9 @@
/* Reference to memory block containing
* objv array (must be kept live throughout
* trace and command invokations.) */
+#ifdef TCL_COMPILE_DEBUG
+ char cmdNameBuf[21];
+#endif
objv = &(stackPtr[stackTop - (objc-1)]);
@@ -3632,8 +3633,7 @@
#ifdef TCL_COMPILE_DEBUG
static void
-ValidatePcAndStackTop(codePtr, pc, stackTop, stackLowerBound,
- stackUpperBound)
+ValidatePcAndStackTop(codePtr, pc, stackTop, stackLowerBound)
register ByteCode *codePtr; /* The bytecode whose summary is printed
* to stdout. */
unsigned char *pc; /* Points to first byte of a bytecode
@@ -3642,8 +3642,9 @@
* stackLowerBound and stackUpperBound
* (inclusive). */
int stackLowerBound; /* Smallest legal value for stackTop. */
- int stackUpperBound; /* Greatest legal value for stackTop. */
{
+ int stackUpperBound = stackLowerBound + codePtr->maxStackDepth;
+ /* Greatest legal value for stackTop. */
unsigned int relativePc = (unsigned int) (pc - codePtr->codeStart);
unsigned int codeStart = (unsigned int) codePtr->codeStart;
unsigned int codeEnd = (unsigned int)