summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--changes7
-rw-r--r--generic/tclCompCmds.c4
2 files changed, 8 insertions, 3 deletions
diff --git a/changes b/changes
index 0f2891c..f41914d 100644
--- a/changes
+++ b/changes
@@ -1,6 +1,6 @@
Recent user-visible changes to Tcl:
-RCS: @(#) $Id: changes,v 1.1.2.4 1998/10/06 02:59:03 stanton Exp $
+RCS: @(#) $Id: changes,v 1.1.2.5 1998/10/06 21:24:23 stanton Exp $
1. No more [command1] [command2] construct for grouping multiple
commands on a single command line.
@@ -3912,3 +3912,8 @@ as starvation of the notifier thread. (BW)
9/22/98 (bug fix) Changed the value of TCL_TRACE_ARRAY so it no longer
conflicts with the deprecated TCL_PARSE_PART1 flag. This should
improve portability of C code. (stanton)
+
+10/6/98 (bug fix) 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. (stanton)
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++;