Index: generic/tclTrace.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclTrace.c,v
retrieving revision 1.33
diff -u -r1.33 tclTrace.c
--- generic/tclTrace.c	11 Apr 2006 14:37:54 -0000	1.33
+++ generic/tclTrace.c	1 Oct 2006 00:04:47 -0000
@@ -2399,10 +2399,23 @@
      */
 
     varPtr = TclLookupVar(interp, varName, NULL, 0, "access",
-	    /*createPart1*/ 0, /*createPart2*/ 1, &arrayPtr);
+	    /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr);
 
     if (varPtr == NULL) {
-	return NULL;
+	if ((arrayPtr != NULL) && (arrayPtr->tracePtr != NULL)) {
+	    /*
+	     * Need to create the array element, in case a trace does
+	     * something with it.
+	     * WARNING: this will terminate all searches on the array!
+	     */
+	    varPtr = TclLookupVar(interp, varName, NULL, 0, "access",
+		    /*createPart1*/ 0, /*createPart2*/ 1, &arrayPtr);
+	    if (varPtr == NULL) {
+		return NULL;
+	    }
+	} else {
+	    return NULL;
+	}
     }
 
     if ((varPtr->tracePtr != NULL)
