Tcl Source Code

Artifact [867d386951]
Login

Artifact 867d3869518574ad20e43ea689890d06d7c73153:

Attachment "tclExecute.c.patch1" to ticket [406709ffff] added by dgp 2001-03-31 03:42:33.
Index: generic/tclExecute.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclExecute.c,v
retrieving revision 1.19
diff -u -r1.19 tclExecute.c
--- generic/tclExecute.c	2001/03/02 15:31:15	1.19
+++ generic/tclExecute.c	2001/03/09 14:36:09
@@ -639,7 +639,19 @@
 			(unsigned int)(pc - codePtr->codeStart),
 			(unsigned int) stackTop,
 			(unsigned int) initStackTop);
-		panic("TclExecuteByteCode execution failure: end stack top != start stack top");
+		if (stackTop > initStackTop) {
+		    /*
+		     * Extra items on stack; this bytecode is defective, but 
+		     * apparently did not corrupt any other data
+		     */
+		    result = TCL_ERROR;
+		    goto abnormalReturn;
+		} else {
+		    /*
+		     * Too few items on the stack, massive data corruption
+		     */		    
+		    panic("TclExecuteByteCode execution failure: end stack top != start stack top");
+		}
 	    }
 	    TRACE_WITH_OBJ(("=> return code=%d, result=", result),
 		    iPtr->objResultPtr);