summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-09-12 19:27:48 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-09-12 19:27:48 (GMT)
commitc34e729136c3608344a630fc086235da2a4092e4 (patch)
tree9275724adb6c65841a633fe0288834d901007846 /generic
parentc12159563db8f0ecce0a00351e1cb0caed2a7acc (diff)
downloadtcl-c34e729136c3608344a630fc086235da2a4092e4.zip
tcl-c34e729136c3608344a630fc086235da2a4092e4.tar.gz
tcl-c34e729136c3608344a630fc086235da2a4092e4.tar.bz2
Push fixup on the stack only when needed.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCompExpr.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c
index 106855a..fce870b 100644
--- a/generic/tclCompExpr.c
+++ b/generic/tclCompExpr.c
@@ -2254,16 +2254,8 @@ CompileExprTree(
if (nodePtr->mark == MARK_LEFT) {
next = nodePtr->left;
- switch (nodePtr->lexeme) {
- case QUESTION:
+ if (nodePtr->lexeme == QUESTION) {
convert = 1;
- break;
- case AND:
- case OR:
- newJump = TclStackAlloc(interp, sizeof(JumpList));
- newJump->next = jumpPtr;
- jumpPtr = newJump;
- break;
}
} else if (nodePtr->mark == MARK_RIGHT) {
next = nodePtr->right;
@@ -2314,10 +2306,12 @@ CompileExprTree(
convert = 1;
break;
case AND:
- TclEmitForwardJump(envPtr, TCL_FALSE_JUMP, &jumpPtr->jump);
- break;
case OR:
- TclEmitForwardJump(envPtr, TCL_TRUE_JUMP, &jumpPtr->jump);
+ newJump = TclStackAlloc(interp, sizeof(JumpList));
+ newJump->next = jumpPtr;
+ jumpPtr = newJump;
+ TclEmitForwardJump(envPtr, (nodePtr->lexeme == AND)
+ ? TCL_FALSE_JUMP : TCL_TRUE_JUMP, &jumpPtr->jump);
break;
}
} else {