summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmds.c
diff options
context:
space:
mode:
authormig <mig>2013-12-22 14:11:46 (GMT)
committermig <mig>2013-12-22 14:11:46 (GMT)
commitc339e592051bb83c9890a27b6709e3929489889b (patch)
treeabf5596d430e74fbf4dfb11c065cf420779be507 /generic/tclCompCmds.c
parent9b9e35d8149caef38c952b2929aedd1c8e6df6a5 (diff)
downloadtcl-c339e592051bb83c9890a27b6709e3929489889b.zip
tcl-c339e592051bb83c9890a27b6709e3929489889b.tar.gz
tcl-c339e592051bb83c9890a27b6709e3929489889b.tar.bz2
remove unnecessary messing around INST_CONTINUE and INST_BREAK: local continue/break are already converted to jumps, so that these are either caught or returned - in either case, the stacks are cleaned up properly by TEBC itself.
Diffstat (limited to 'generic/tclCompCmds.c')
-rw-r--r--generic/tclCompCmds.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index d6f01a8..c774a5e 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -489,17 +489,14 @@ TclCompileBreakCmd(
TclCleanupStackForBreakContinue(envPtr, auxPtr);
TclAddLoopBreakFixup(envPtr, auxPtr);
- TclAdjustStackDepth(1, envPtr);
} else {
/*
* Emit a real break.
*/
- PushStringLiteral(envPtr, "");
- TclEmitOpcode(INST_DUP, envPtr);
- TclEmitInstInt4(INST_RETURN_IMM, TCL_BREAK, envPtr);
- TclEmitInt4(0, envPtr);
+ TclEmitOpcode(INST_BREAK, envPtr);
}
+ TclAdjustStackDepth(1, envPtr);
return TCL_OK;
}
@@ -735,17 +732,14 @@ TclCompileContinueCmd(
TclCleanupStackForBreakContinue(envPtr, auxPtr);
TclAddLoopContinueFixup(envPtr, auxPtr);
- TclAdjustStackDepth(1, envPtr);
} else {
/*
* Emit a real continue.
*/
- PushStringLiteral(envPtr, "");
- TclEmitOpcode(INST_DUP, envPtr);
- TclEmitInstInt4(INST_RETURN_IMM, TCL_CONTINUE, envPtr);
- TclEmitInt4(0, envPtr);
+ TclEmitOpcode(INST_CONTINUE, envPtr);
}
+ TclAdjustStackDepth(1, envPtr);
return TCL_OK;
}