summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2008-02-12 10:27:26 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2008-02-12 10:27:26 (GMT)
commita0d41bb652b196bbd0c803b2b99e9ea7e90ea72d (patch)
tree1015742b0c591ebbf006e3238cce06d43e40164f /generic
parent6711d80d15faa5f9241e77a778c4b81a537730ec (diff)
downloadtcl-a0d41bb652b196bbd0c803b2b99e9ea7e90ea72d.zip
tcl-a0d41bb652b196bbd0c803b2b99e9ea7e90ea72d.tar.gz
tcl-a0d41bb652b196bbd0c803b2b99e9ea7e90ea72d.tar.bz2
Fix [Bug 1891827]
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCompCmds.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 5b5cd93..82edcd7 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCompCmds.c,v 1.140 2008/01/23 19:41:27 dgp Exp $
+ * RCS: @(#) $Id: tclCompCmds.c,v 1.141 2008/02/12 10:27:26 dkf Exp $
*/
#include "tclInt.h"
@@ -3967,7 +3967,7 @@ TclCompileSwitchCmd(
}
tokenPtr = TokenAfter(tokenPtr);
numWords--;
- if (noCase && (mode != Switch_Exact)) {
+ if (noCase && (mode == Switch_Exact)) {
/*
* Can't compile this case; no opcode for case-insensitive equality!
*/
@@ -4376,6 +4376,7 @@ TclCompileSwitchCmd(
foundDefault = 0;
for (i=0 ; i<numWords ; i+=2) {
int nextArmFixupIndex = -1;
+
envPtr->currStackDepth = savedStackDepth + 1;
if (i!=numWords-2 || bodyToken[numWords-2]->size != 7 ||
memcmp(bodyToken[numWords-2]->start, "default", 7)) {
@@ -4400,6 +4401,7 @@ TclCompileSwitchCmd(
/*
* Keep in sync with TclCompileRegexpCmd.
*/
+
if (bodyToken[i]->type == TCL_TOKEN_TEXT) {
Tcl_DString ds;
@@ -4439,13 +4441,15 @@ TclCompileSwitchCmd(
}
} else {
/*
- * Pass correct RE compile flags. We use only Int1
+ * Pass correct RE compile flags. We use only Int1
* (8-bit), but that handles all the flags we want to
- * pass. Don't use TCL_REG_NOSUB as we may have backrefs
+ * pass. Don't use TCL_REG_NOSUB as we may have backrefs
* or capture vars.
*/
+
int cflags = TCL_REG_ADVANCED
- | (noCase ? TCL_REG_NOCASE : 0);
+ | (noCase ? TCL_REG_NOCASE : 0);
+
TclEmitInstInt1(INST_REGEXP, cflags, envPtr);
}
break;