summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-06-02 03:11:34 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-06-02 03:11:34 (GMT)
commit83b74d8b93717170d06c75c19c7b92defe9100d7 (patch)
tree0bb29c69c4c95b10f1a65088aa7250e8dd58528b
parent739062154a9a146d256d6138ad44358b9d53d55d (diff)
downloadtcl-83b74d8b93717170d06c75c19c7b92defe9100d7.zip
tcl-83b74d8b93717170d06c75c19c7b92defe9100d7.tar.gz
tcl-83b74d8b93717170d06c75c19c7b92defe9100d7.tar.bz2
This close to a release, simple is better.
-rw-r--r--ChangeLog3
-rw-r--r--generic/tclProc.c4
-rw-r--r--generic/tclResult.c4
-rw-r--r--tests/result.test9
4 files changed, 11 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 969e497..28572fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,5 @@
2005-06-01 Don Porter <dgp@users.sourceforge.net>
- * generic/tclProc.c: Revised fix for [Bug 1209759] is more complex,
- * generic/tclResult.c: but should have less performance impact.
-
* generic/tclBasic.c: For compatibility with earlier Tcl releases,
* generic/tclResult.c: when a command procedure simply does a
* generic/tclTest.c: "return TCL_RETURN;" we must interpret that
diff --git a/generic/tclProc.c b/generic/tclProc.c
index c1c12f9..cd53cff 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.75 2005/06/01 22:19:16 dgp Exp $
+ * RCS: @(#) $Id: tclProc.c,v 1.76 2005/06/02 03:11:37 dgp Exp $
*/
#include "tclInt.h"
@@ -1672,8 +1672,6 @@ TclUpdateReturnInfo(iPtr)
if (iPtr->returnLevel == 0) {
/* Now we've reached the level to return the requested -code */
code = iPtr->returnCode;
- iPtr->returnLevel = 1;
- iPtr->returnCode = TCL_OK;
}
return code;
}
diff --git a/generic/tclResult.c b/generic/tclResult.c
index 611b85f..1266191 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclResult.c,v 1.27 2005/06/01 22:19:16 dgp Exp $
+ * RCS: @(#) $Id: tclResult.c,v 1.28 2005/06/02 03:11:38 dgp Exp $
*/
#include "tclInt.h"
@@ -927,6 +927,8 @@ Tcl_ResetResult(interp)
Tcl_DecrRefCount(iPtr->errorInfo);
iPtr->errorInfo = NULL;
}
+ iPtr->returnLevel = 1;
+ iPtr->returnCode = TCL_OK;
if (iPtr->returnOpts) {
Tcl_DecrRefCount(iPtr->returnOpts);
iPtr->returnOpts = NULL;
diff --git a/tests/result.test b/tests/result.test
index ff60713..4337ef3 100644
--- a/tests/result.test
+++ b/tests/result.test
@@ -111,11 +111,16 @@ test result-5.4 {Tcl_SetErrorCode - two args, list quoting} testseterrorcode {
::tcltest::testConstraint testreturn \
[expr {[info commands testreturn] != {}}]
-test result-6.0 {Bug 1209759} testreturn {
+test result-6.0 {Bug 1209759} -constraints testreturn -body {
# Might panic if bug is not fixed.
proc foo {} {testreturn}
foo
-} {}
+} -returnCodes ok -result {}
+test result-6.1 {Bug 1209759} -constraints testreturn -body {
+ # Might panic if bug is not fixed.
+ proc foo {} {catch {return -level 2}; testreturn}
+ foo
+} -returnCodes ok -result {}
# cleanup
::tcltest::cleanupTests