summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authormig <mig>2013-12-11 15:16:20 (GMT)
committermig <mig>2013-12-11 15:16:20 (GMT)
commitd83a8d3b91859aa6d510256f3b26c4a3d98bdd5d (patch)
treeadbfd056058406083e6632068cb175f88cd45e73 /generic
parent13a7f30bb1ad0a3bb814f20efe88d5eb02d9e453 (diff)
downloadtcl-d83a8d3b91859aa6d510256f3b26c4a3d98bdd5d.zip
tcl-d83a8d3b91859aa6d510256f3b26c4a3d98bdd5d.tar.gz
tcl-d83a8d3b91859aa6d510256f3b26c4a3d98bdd5d.tar.bz2
simplify: remove the special case
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCompCmds.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 65c50eb..dbc876a 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -616,25 +616,6 @@ TclCompileCatchCmd(
}
ExceptionRangeEnds(envPtr, range);
- if (resultIndex == -1) {
- /*
- * Special case when neither result nor options are being saved. In
- * that case, we can skip quite a bit of the command epilogue; all we
- * have to do is drop the result and push the return code (and, of
- * course, finish the catch context).
- */
-
- TclEmitOpcode( INST_POP, envPtr);
- PushStringLiteral(envPtr, "0");
- TclEmitInstInt1( INST_JUMP1, 3, envPtr);
- TclAdjustStackDepth(-1, envPtr);
- ExceptionRangeTarget(envPtr, range, catchOffset);
- TclEmitOpcode( INST_PUSH_RETURN_CODE, envPtr);
- ExceptionRangeEnds(envPtr, range);
- TclEmitOpcode( INST_END_CATCH, envPtr);
- return TCL_OK;
- }
-
/*
* Emit the "no errors" epilogue: push "0" (TCL_OK) as the catch result,
* and jump around the "error case" code.
@@ -687,8 +668,10 @@ TclCompileCatchCmd(
*/
TclEmitInstInt4( INST_REVERSE, 2, envPtr);
- Emit14Inst( INST_STORE_SCALAR, resultIndex, envPtr);
- TclEmitOpcode( INST_POP, envPtr);
+ if (resultIndex != -1) {
+ Emit14Inst( INST_STORE_SCALAR, resultIndex, envPtr);
+ }
+ TclEmitOpcode( INST_POP, envPtr);
return TCL_OK;
}