summaryrefslogtreecommitdiffstats
path: root/generic/tclCompile.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2015-08-02 12:22:02 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2015-08-02 12:22:02 (GMT)
commit034f00bf1ba81be55756adc152834ef9660ba9a9 (patch)
treebaba75f9008a34f23b8781996a04a40229ec00fc /generic/tclCompile.c
parent29603179f48fc0e6920e78398c477f40d0fb4421 (diff)
downloadtcl-034f00bf1ba81be55756adc152834ef9660ba9a9.zip
tcl-034f00bf1ba81be55756adc152834ef9660ba9a9.tar.gz
tcl-034f00bf1ba81be55756adc152834ef9660ba9a9.tar.bz2
Fix more problems with break and continue in for-step clauses.
Diffstat (limited to 'generic/tclCompile.c')
-rw-r--r--generic/tclCompile.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 478881d..f62ec14 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -4083,16 +4083,6 @@ TclEmitInvoke(
* calls from inside a [for] increment clause).
*/
- rangePtr = TclGetInnermostExceptionRange(envPtr, TCL_BREAK, &auxBreakPtr);
- if (rangePtr == NULL || rangePtr->type != LOOP_EXCEPTION_RANGE) {
- auxBreakPtr = NULL;
- } else if (auxBreakPtr->stackDepth == envPtr->currStackDepth-wordCount
- && auxBreakPtr->expandTarget == envPtr->expandCount-expandCount) {
- auxBreakPtr = NULL;
- } else {
- breakRange = auxBreakPtr - envPtr->exceptAuxArrayPtr;
- }
-
rangePtr = TclGetInnermostExceptionRange(envPtr, TCL_CONTINUE,
&auxContinuePtr);
if (rangePtr == NULL || rangePtr->type != LOOP_EXCEPTION_RANGE) {
@@ -4104,6 +4094,17 @@ TclEmitInvoke(
continueRange = auxContinuePtr - envPtr->exceptAuxArrayPtr;
}
+ rangePtr = TclGetInnermostExceptionRange(envPtr, TCL_BREAK, &auxBreakPtr);
+ if (rangePtr == NULL || rangePtr->type != LOOP_EXCEPTION_RANGE) {
+ auxBreakPtr = NULL;
+ } else if (auxContinuePtr == NULL
+ && auxBreakPtr->stackDepth == envPtr->currStackDepth-wordCount
+ && auxBreakPtr->expandTarget == envPtr->expandCount-expandCount) {
+ auxBreakPtr = NULL;
+ } else {
+ breakRange = auxBreakPtr - envPtr->exceptAuxArrayPtr;
+ }
+
if (auxBreakPtr != NULL || auxContinuePtr != NULL) {
loopRange = TclCreateExceptRange(LOOP_EXCEPTION_RANGE, envPtr);
ExceptionRangeStarts(envPtr, loopRange);