summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--generic/tclCompile.c6
-rw-r--r--generic/tclProc.c8
3 files changed, 14 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 6b88c4c..0847fd9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-07-11 Miguel Sofer <msofer@users.sourceforge.net>
+
+ * generic/tclCompile.c: now setting local vars undefined at
+ compile time, instead of waiting until the proc is initialized.
+ * generic/tclProc.c: use macro TclSetVarUndefined instead of
+ directly etting the flag.
+
2002-07-11 Donal K. Fellows <fellowsd@cs.man.ac.uk>
* tests/cmdAH.test: [file attr -perm] is Unix-only, so add [catch]
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 83ff215..20d0448 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCompile.c,v 1.37 2002/06/17 22:52:51 hobbs Exp $
+ * RCS: @(#) $Id: tclCompile.c,v 1.38 2002/07/11 12:39:16 msofer Exp $
*/
#include "tclInt.h"
@@ -1770,7 +1770,7 @@ TclFindCompiledLocal(name, nameBytes, create, flags, procPtr)
localPtr->nextPtr = NULL;
localPtr->nameLength = nameBytes;
localPtr->frameIndex = localVar;
- localPtr->flags = flags;
+ localPtr->flags = flags | VAR_UNDEFINED;
if (name == NULL) {
localPtr->flags |= VAR_TEMPORARY;
}
@@ -1894,7 +1894,7 @@ TclInitCompiledLocals(interp, framePtr, nsPtr)
varPtr->refCount = 0;
varPtr->tracePtr = NULL;
varPtr->searchPtr = NULL;
- varPtr->flags = (localPtr->flags | VAR_UNDEFINED);
+ varPtr->flags = localPtr->flags;
}
varPtr++;
}
diff --git a/generic/tclProc.c b/generic/tclProc.c
index 446bf09..91d6714 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclProc.c,v 1.37 2002/04/15 17:45:06 msofer Exp $
+ * RCS: @(#) $Id: tclProc.c,v 1.38 2002/07/11 12:39:16 msofer Exp $
*/
#include "tclInt.h"
@@ -1007,19 +1007,19 @@ TclObjInterpProc(clientData, interp, objc, objv)
Tcl_Obj *listPtr = Tcl_NewListObj(argCt, &(objv[i]));
varPtr->value.objPtr = listPtr;
Tcl_IncrRefCount(listPtr); /* local var is a reference */
- varPtr->flags &= ~VAR_UNDEFINED;
+ TclClearVarUndefined(varPtr);
argCt = 0;
break; /* done processing args */
} else if (argCt > 0) {
Tcl_Obj *objPtr = objv[i];
varPtr->value.objPtr = objPtr;
- varPtr->flags &= ~VAR_UNDEFINED;
+ TclClearVarUndefined(varPtr);
Tcl_IncrRefCount(objPtr); /* since the local variable now has
* another reference to object. */
} else if (localPtr->defValuePtr != NULL) {
Tcl_Obj *objPtr = localPtr->defValuePtr;
varPtr->value.objPtr = objPtr;
- varPtr->flags &= ~VAR_UNDEFINED;
+ TclClearVarUndefined(varPtr);
Tcl_IncrRefCount(objPtr); /* since the local variable now has
* another reference to object. */
} else {