summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tclAssembly.c15
-rw-r--r--generic/tclBasic.c5
-rw-r--r--generic/tclCompile.c6
3 files changed, 13 insertions, 13 deletions
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c
index 1a061f0..0722eb9 100644
--- a/generic/tclAssembly.c
+++ b/generic/tclAssembly.c
@@ -1013,8 +1013,6 @@ TclAssembleCode(
const char* instPtr = codePtr;
/* Where to start looking for a line of code */
- int instLen; /* Length in bytes of the current line of
- * code */
const char* nextPtr; /* Pointer to the end of the line of code */
int bytesLeft = codeLen; /* Number of bytes of source code remaining to
* be parsed */
@@ -1028,10 +1026,6 @@ TclAssembleCode(
*/
status = Tcl_ParseCommand(interp, instPtr, bytesLeft, 0, parsePtr);
- instLen = parsePtr->commandSize;
- if (parsePtr->term == parsePtr->commandStart + instLen - 1) {
- --instLen;
- }
/*
* Report errors in the parse.
@@ -1040,7 +1034,7 @@ TclAssembleCode(
if (status != TCL_OK) {
if (flags & TCL_EVAL_DIRECT) {
Tcl_LogCommandInfo(interp, codePtr, parsePtr->commandStart,
- instLen);
+ parsePtr->term + 1 - parsePtr->commandStart);
}
FreeAssemblyEnv(assemEnvPtr);
return TCL_ERROR;
@@ -1060,6 +1054,13 @@ TclAssembleCode(
*/
if (parsePtr->numWords > 0) {
+ int instLen = parsePtr->commandSize;
+ /* Length in bytes of the current command */
+
+ if (parsePtr->term == parsePtr->commandStart + instLen - 1) {
+ --instLen;
+ }
+
/*
* If tracing, show each line assembled as it happens.
*/
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index bd4f157..82affb0 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -5082,7 +5082,9 @@ TclEvalEx(
do {
if (Tcl_ParseCommand(interp, p, bytesLeft, 0, parsePtr) != TCL_OK) {
code = TCL_ERROR;
- goto error;
+ Tcl_LogCommandInfo(interp, script, parsePtr->commandStart,
+ parsePtr->term + 1 - parsePtr->commandStart);
+ goto posterror;
}
/*
@@ -5338,6 +5340,7 @@ TclEvalEx(
Tcl_LogCommandInfo(interp, script, parsePtr->commandStart,
commandLength);
}
+ posterror:
iPtr->flags &= ~ERR_ALREADY_LOGGED;
/*
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 763e8f1..a52ad3e 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -2109,7 +2109,6 @@ TclCompileScript(
Tcl_LogCommandInfo(interp, script, parse.commandStart,
parse.term + 1 - parse.commandStart);
TclCompileSyntaxError(interp, envPtr);
- Tcl_FreeParse(&parse);
return;
}
@@ -2242,10 +2241,7 @@ TclCompileScript(
*/
Tcl_LogCommandInfo(interp, script, parsePtr->commandStart,
- /* Drop the command terminator (";","]") if appropriate */
- (parsePtr->term ==
- parsePtr->commandStart + parsePtr->commandSize - 1)?
- parsePtr->commandSize - 1 : parsePtr->commandSize);
+ parsePtr->term + 1 - parsePtr->commandStart);
TclCompileSyntaxError(interp, envPtr);
break;
}