summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmds.c
diff options
context:
space:
mode:
authorstanton <stanton>1998-10-06 21:24:23 (GMT)
committerstanton <stanton>1998-10-06 21:24:23 (GMT)
commitaea8306abb880c9d2d7e31089e92348b137e4935 (patch)
tree5cc8dec6a97313e719c3cb5e0425792b48581177 /generic/tclCompCmds.c
parent69ed9634cab320e41ff310ecc896024b2bbc975a (diff)
downloadtcl-aea8306abb880c9d2d7e31089e92348b137e4935.zip
tcl-aea8306abb880c9d2d7e31089e92348b137e4935.tar.gz
tcl-aea8306abb880c9d2d7e31089e92348b137e4935.tar.bz2
8.1a2 bug: The compile procedure for "if" incorrectly attempted to
match against the literal string "if", resulting in a stack overflow when "::if" was compiled. It also would incorrectly accept "if" instead of "elsif" in later clauses.
Diffstat (limited to 'generic/tclCompCmds.c')
-rw-r--r--generic/tclCompCmds.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index bbb85dc..280ad62 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -9,7 +9,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.1.2.5 1998/10/06 00:35:22 stanton Exp $
+ * RCS: @(#) $Id: tclCompCmds.c,v 1.1.2.6 1998/10/06 21:24:26 stanton Exp $
*/
#include "tclInt.h"
@@ -1055,7 +1055,7 @@ TclCompileIfCmd(interp, parsePtr, envPtr)
}
word = tokenPtr[1].start;
numBytes = tokenPtr[1].size;
- if (((numBytes == 2) && (strncmp(word, "if", 2) == 0))
+ if ((tokenPtr == parsePtr->tokenPtr)
|| ((numBytes == 6) && (strncmp(word, "elseif", 6) == 0))) {
tokenPtr += (tokenPtr->numComponents + 1);
wordIdx++;