summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-07-10 19:34:55 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-07-10 19:34:55 (GMT)
commit6f87f7f3302077aa68a48258e328bbf2ee5abd51 (patch)
treea5078e6b7f90d4cc59c625bbcc62089af2c81ba5 /generic
parentc8a526a72209d5f16d6d264b5849d4ea211d7139 (diff)
downloadtcl-6f87f7f3302077aa68a48258e328bbf2ee5abd51.zip
tcl-6f87f7f3302077aa68a48258e328bbf2ee5abd51.tar.gz
tcl-6f87f7f3302077aa68a48258e328bbf2ee5abd51.tar.bz2
Add tests for, and fix bugs in, the SetLineInformation() calls in tclCompCmds.c.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCompCmds.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 13318a3..28a3e64 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -1651,7 +1651,7 @@ TclCompileDictUpdateCmd(
TclEmitInstInt4( INST_BEGIN_CATCH4, range, envPtr);
ExceptionRangeStarts(envPtr, range);
- SetLineInformation(parsePtr->numWords - 1);
+ LineInformation(parsePtr->numWords - 1);
CompileBody(envPtr, bodyTokenPtr, interp);
ExceptionRangeEnds(envPtr, range);
@@ -1992,7 +1992,7 @@ TclCompileDictWithCmd(
TclEmitInstInt4( INST_BEGIN_CATCH4, range, envPtr);
ExceptionRangeStarts(envPtr, range);
- SetLineInformation(parsePtr->numWords-1);
+ LineInformation(parsePtr->numWords-1);
CompileBody(envPtr, tokenPtr, interp);
ExceptionRangeEnds(envPtr, range);
@@ -2268,7 +2268,7 @@ TclCompileForCmd(
* Inline compile the initial command.
*/
- SetLineInformation(1);
+ LineInformation(1);
CompileBody(envPtr, startTokenPtr, interp);
TclEmitOpcode(INST_POP, envPtr);
@@ -2292,7 +2292,7 @@ TclCompileForCmd(
bodyRange = TclCreateExceptRange(LOOP_EXCEPTION_RANGE, envPtr);
bodyCodeOffset = ExceptionRangeStarts(envPtr, bodyRange);
- SetLineInformation(4);
+ LineInformation(4);
CompileBody(envPtr, bodyTokenPtr, interp);
ExceptionRangeEnds(envPtr, bodyRange);
TclEmitOpcode(INST_POP, envPtr);
@@ -2306,7 +2306,7 @@ TclCompileForCmd(
nextRange = TclCreateExceptRange(LOOP_EXCEPTION_RANGE, envPtr);
envPtr->exceptAuxArrayPtr[nextRange].supportsContinue = 0;
nextCodeOffset = ExceptionRangeStarts(envPtr, nextRange);
- SetLineInformation(3);
+ LineInformation(3);
CompileBody(envPtr, nextTokenPtr, interp);
ExceptionRangeEnds(envPtr, nextRange);
TclEmitOpcode(INST_POP, envPtr);
@@ -2325,7 +2325,7 @@ TclCompileForCmd(
testCodeOffset += 3;
}
- SetLineInformation(2);
+ LineInformation(2);
TclCompileExprWords(interp, testTokenPtr, 1, envPtr);
jumpDist = CurrentOffset(envPtr) - bodyCodeOffset;
@@ -2464,7 +2464,7 @@ CompileEachloopCmd(
Tcl_Token *tokenPtr, *bodyTokenPtr;
unsigned char *jumpPc;
JumpFixup jumpFalseFixup;
- int jumpBackDist, jumpBackOffset, infoIndex, range, bodyIndex;
+ int jumpBackDist, jumpBackOffset, infoIndex, range;
int numWords, numLists, numVars, loopIndex, tempVar, i, j, code;
DefineLineInformation; /* TIP #280 */
@@ -2504,8 +2504,6 @@ CompileEachloopCmd(
return TCL_ERROR;
}
- bodyIndex = i-1;
-
/*
* Allocate storage for the varcList and varvList arrays if necessary.
*/
@@ -2646,7 +2644,7 @@ CompileEachloopCmd(
i < numWords-1;
i++, tokenPtr = TokenAfter(tokenPtr)) {
if ((i%2 == 0) && (i > 0)) {
- SetLineInformation(i);
+ LineInformation(i);
CompileTokens(envPtr, tokenPtr, interp);
tempVar = (firstValueTemp + loopIndex);
Emit14Inst( INST_STORE_SCALAR, tempVar, envPtr);
@@ -2684,7 +2682,7 @@ CompileEachloopCmd(
* Inline compile the loop body.
*/
- SetLineInformation(bodyIndex);
+ LineInformation(numWords - 1);
ExceptionRangeStarts(envPtr, range);
CompileBody(envPtr, bodyTokenPtr, interp);
ExceptionRangeEnds(envPtr, range);