summaryrefslogtreecommitdiffstats
path: root/generic/tclCompile.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-06-26 03:46:54 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-06-26 03:46:54 (GMT)
commita0860b63fb252ca05d70706533db45c410b95c0e (patch)
treee77aae85dd296f2fb00d368692682fc332880ae4 /generic/tclCompile.c
parentcfc5628d95dc74341aa80381da850c2f174d8103 (diff)
downloadtcl-a0860b63fb252ca05d70706533db45c410b95c0e.zip
tcl-a0860b63fb252ca05d70706533db45c410b95c0e.tar.gz
tcl-a0860b63fb252ca05d70706533db45c410b95c0e.tar.bz2
A few bug fixes from failing tests; still leaky.
Diffstat (limited to 'generic/tclCompile.c')
-rw-r--r--generic/tclCompile.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 955078c..626c5ae 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -2076,7 +2076,10 @@ TclCompileScript(
*/
Tcl_LogCommandInfo(interp, script, parse.commandStart,
- parse.term - parse.commandStart);
+ /* Drop the command terminator (";","]") if appropriate */
+ (parse.term ==
+ parse.commandStart + parse.commandSize - 1)?
+ parse.commandSize - 1 : parse.commandSize);
TclCompileSyntaxError(interp, envPtr);
break;
}
@@ -2142,7 +2145,7 @@ TclCompileScript(
if (envPtr->codeNext == entryCodeNext) {
PushStringLiteral(envPtr, "");
- } else {
+ } else if (envPtr->codeNext[-1] == INST_POP) {
/* Remove the surplus INST_POP */
envPtr->codeNext--;
TclAdjustStackDepth(1, envPtr);