summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormig <mig>2013-12-22 14:11:46 (GMT)
committermig <mig>2013-12-22 14:11:46 (GMT)
commit4c7d267ddb333ab1d5b6caddfdd8803def611dd0 (patch)
treeabf5596d430e74fbf4dfb11c065cf420779be507
parent187d698fba3de0798b35122985b1616defa1f8e2 (diff)
downloadtcl-4c7d267ddb333ab1d5b6caddfdd8803def611dd0.zip
tcl-4c7d267ddb333ab1d5b6caddfdd8803def611dd0.tar.gz
tcl-4c7d267ddb333ab1d5b6caddfdd8803def611dd0.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.
-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;
}