summaryrefslogtreecommitdiffstats
path: root/generic/tclVar.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2007-08-04 18:32:27 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2007-08-04 18:32:27 (GMT)
commit5f27bf51933b916e9e5c01a9403a74ef83741b6a (patch)
tree2d828b3d553ad34b9c79c634979526e3a7d04876 /generic/tclVar.c
parentf234f8dce1ac71dd3a9aa6bfb4d1e48bb0c986ba (diff)
downloadtcl-5f27bf51933b916e9e5c01a9403a74ef83741b6a.zip
tcl-5f27bf51933b916e9e5c01a9403a74ef83741b6a.tar.gz
tcl-5f27bf51933b916e9e5c01a9403a74ef83741b6a.tar.bz2
modifs to help itcl adapt to VarReform
Diffstat (limited to 'generic/tclVar.c')
-rw-r--r--generic/tclVar.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 8405c5f..acb2834 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -16,7 +16,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclVar.c,v 1.148 2007/08/03 13:51:41 dkf Exp $
+ * RCS: @(#) $Id: tclVar.c,v 1.149 2007/08/04 18:32:28 msofer Exp $
*/
#include "tclInt.h"
@@ -238,6 +238,23 @@ Tcl_ObjType tclArraySearchType = {
"array search",
NULL, NULL, NULL, SetArraySearchObj
};
+
+Var *
+TclVarHashCreateVar(
+ TclVarHashTable *tablePtr,
+ const char *key,
+ int *newPtr)
+{
+ Tcl_Obj *keyPtr;
+ Var *varPtr;
+
+ keyPtr = Tcl_NewStringObj(key, -1);
+ Tcl_IncrRefCount(keyPtr);
+ varPtr = VarHashCreateVar(tablePtr, keyPtr, newPtr);
+ Tcl_DecrRefCount(keyPtr);
+
+ return varPtr;
+}
/*
*----------------------------------------------------------------------
@@ -2288,7 +2305,7 @@ UnsetVarStruct(
}
if ((dummyVar.flags & VAR_TRACED_UNSET)
- || (arrayPtr->flags & VAR_TRACED_UNSET)) {
+ || (arrayPtr && (arrayPtr->flags & VAR_TRACED_UNSET))) {
dummyVar.flags &= ~VAR_TRACE_ACTIVE;
TclObjCallVarTraces(iPtr, arrayPtr, (Var *) &dummyVar,
part1Ptr, part2Ptr,