summaryrefslogtreecommitdiffstats
path: root/generic/tclAssembly.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-07-18 15:42:54 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-07-18 15:42:54 (GMT)
commit64759df0b78b38806d06382708eaebe16ce7c07e (patch)
tree10b1fe79c403e17da470df6f8eb602fc0b7c1a7d /generic/tclAssembly.c
parent6d2beac7e80048bcc4d4d46c68ec4f55d90986b3 (diff)
parent517197f8571ca5ff1c51b2cadc771505922d9137 (diff)
downloadtcl-64759df0b78b38806d06382708eaebe16ce7c07e.zip
tcl-64759df0b78b38806d06382708eaebe16ce7c07e.tar.gz
tcl-64759df0b78b38806d06382708eaebe16ce7c07e.tar.bz2
merge trunk
Diffstat (limited to 'generic/tclAssembly.c')
-rw-r--r--generic/tclAssembly.c15
1 files changed, 8 insertions, 7 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.
*/