summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmdsSZ.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-09-19 18:53:01 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-09-19 18:53:01 (GMT)
commit7b3702821be88e66474de1c1b1aa84c381276668 (patch)
treecfdbb08e5f959f29f643d207e6466edcebc494d0 /generic/tclCompCmdsSZ.c
parent91ec52b16e7cd903ca196560e5ddb1d5ca1c60a9 (diff)
downloadtcl-7b3702821be88e66474de1c1b1aa84c381276668.zip
tcl-7b3702821be88e66474de1c1b1aa84c381276668.tar.gz
tcl-7b3702821be88e66474de1c1b1aa84c381276668.tar.bz2
Line numbers wrong in compiled [unset].
Diffstat (limited to 'generic/tclCompCmdsSZ.c')
-rw-r--r--generic/tclCompCmdsSZ.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index d1eb9db..6c55e2e 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -2814,26 +2814,26 @@ TclCompileUnsetCmd(
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Token *varTokenPtr;
- int isScalar, localIndex, numWords, flags, i;
+ int isScalar, localIndex, flags, i;
Tcl_Obj *leadingWord;
DefineLineInformation; /* TIP #280 */
/* TODO: Consider support for compiling expanded args. */
- numWords = parsePtr->numWords-1;
flags = 1;
+ i = 1;
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
leadingWord = Tcl_NewObj();
- if (numWords > 0 && TclWordKnownAtCompileTime(varTokenPtr, leadingWord)) {
+ if (parsePtr->numWords > 1 && TclWordKnownAtCompileTime(varTokenPtr, leadingWord)) {
int len;
const char *bytes = Tcl_GetStringFromObj(leadingWord, &len);
if (len == 11 && !strncmp("-nocomplain", bytes, 11)) {
flags = 0;
varTokenPtr = TokenAfter(varTokenPtr);
- numWords--;
+ i++;
} else if (len == 2 && !strncmp("--", bytes, 2)) {
varTokenPtr = TokenAfter(varTokenPtr);
- numWords--;
+ i++;
}
} else {
/*
@@ -2846,7 +2846,7 @@ TclCompileUnsetCmd(
}
TclDecrRefCount(leadingWord);
- for (i=0 ; i<numWords ; i++) {
+ for ( ; i<parsePtr->numWords ; i++) {
/*
* Decide if we can use a frame slot for the var/array name or if we
* need to emit code to compute and push the name at runtime. We use a
@@ -2856,7 +2856,7 @@ TclCompileUnsetCmd(
*/
PushVarNameWord(interp, varTokenPtr, envPtr, 0,
- &localIndex, &isScalar, 1);
+ &localIndex, &isScalar, i);
/*
* Emit instructions to unset the variable.