Tcl Source Code

Artifact [f77e25804c]
Login

Artifact f77e25804cb4f105297f8021d6a12b6e0b1b2a79:

Attachment "2152286.patch" to ticket [2152286fff] added by dgp 2008-10-20 02:50:54.
? 2152286.patch
? bump.patch
? debug
? unix/dltest.marker
Index: generic/tclProc.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclProc.c,v
retrieving revision 1.139.2.3
diff -u -r1.139.2.3 tclProc.c
--- generic/tclProc.c	11 Aug 2008 19:01:59 -0000	1.139.2.3
+++ generic/tclProc.c	19 Oct 2008 19:49:39 -0000
@@ -2239,9 +2239,14 @@
     if (iPtr->returnLevel == 0) {
 	/*
 	 * Now we've reached the level to return the requested -code.
+	 * Since iPtr->returnLevel and iPtr->returnCode have completed
+	 * their task, we now reset them to default values so that any
+	 * bare "return TCL_RETURN" that may follow will work [Bug 2152286].
 	 */
 
 	code = iPtr->returnCode;
+	iPtr->returnLevel = 1;
+	iPtr->returnCode = TCL_OK;
 	if (code == TCL_ERROR) {
 	    iPtr->flags |= ERR_LEGACY_COPY;
 	}