summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmds.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2003-03-19 16:51:41 (GMT)
committerdgp <dgp@users.sourceforge.net>2003-03-19 16:51:41 (GMT)
commitd9155272bb564f8042c5e7ff324807a01c31bc83 (patch)
treeae9311f08dbcb62362114996a3674c7d55de2c9c /generic/tclCompCmds.c
parentdd21b2af3a8ddd0cbcffc3949ed0f9f581042d01 (diff)
downloadtcl-d9155272bb564f8042c5e7ff324807a01c31bc83.zip
tcl-d9155272bb564f8042c5e7ff324807a01c31bc83.tar.gz
tcl-d9155272bb564f8042c5e7ff324807a01c31bc83.tar.bz2
* generic/tclCompCmds.c (TclCompileReturnCmd): Alternative fix for
* generic/tclCompile.c (INST_RETURN): [Bug 633204] that uses a new * generic/tclCompile.h (INST_RETURN): bytecode INST_RETURN to * generic/tclExecute.c (INST_RETURN): properly bytecode the [return] command to something that returns TCL_RETURN.
Diffstat (limited to 'generic/tclCompCmds.c')
-rw-r--r--generic/tclCompCmds.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 44f6109..fdd339b 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -11,7 +11,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.42 2003/03/13 02:48:52 dgp Exp $
+ * RCS: @(#) $Id: tclCompCmds.c,v 1.43 2003/03/19 16:51:42 dgp Exp $
*/
#include "tclInt.h"
@@ -2371,7 +2371,6 @@ TclCompileReturnCmd(interp, parsePtr, envPtr)
{
Tcl_Token *varTokenPtr;
int code;
- int index = envPtr->exceptArrayNext - 1;
/*
* If we're not in a procedure, don't compile.
@@ -2381,22 +2380,6 @@ TclCompileReturnCmd(interp, parsePtr, envPtr)
return TCL_OUT_LINE_COMPILE;
}
- /*
- * Look back through the ExceptionRanges of the current CompileEnv,
- * from exceptArrayPtr[(exceptArrayNext - 1)] down to
- * exceptArrayPtr[0] to see if any of them is an enclosing [catch].
- * If there's an enclosing [catch], don't compile.
- */
-
- while (index >= 0) {
- ExceptionRange range = envPtr->exceptArrayPtr[index];
- if ((range.type == CATCH_EXCEPTION_RANGE)
- && (range.catchOffset == -1)) {
- return TCL_OUT_LINE_COMPILE;
- }
- index--;
- }
-
switch (parsePtr->numWords) {
case 1: {
/*
@@ -2448,11 +2431,11 @@ TclCompileReturnCmd(interp, parsePtr, envPtr)
}
/*
- * The INST_DONE opcode actually causes the branching out of the
+ * The INST_RETURN opcode triggers the branching out of the
* subroutine, and takes the top stack item as the return result
* (which is why we pushed the value above).
*/
- TclEmitOpcode(INST_DONE, envPtr);
+ TclEmitOpcode(INST_RETURN, envPtr);
return TCL_OK;
}