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)
commit2aed1acbd1bd855bbee0a630877ba16b50c84d58 (patch)
tree10b1fe79c403e17da470df6f8eb602fc0b7c1a7d /generic/tclAssembly.c
parentc2d6c48dd921e7120d626f1a85977ae130dd109e (diff)
parent81a1a91361cc615d3e9bf5b9016bd12cd258aa8d (diff)
downloadtcl-2aed1acbd1bd855bbee0a630877ba16b50c84d58.zip
tcl-2aed1acbd1bd855bbee0a630877ba16b50c84d58.tar.gz
tcl-2aed1acbd1bd855bbee0a630877ba16b50c84d58.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.
*/