Tcl Source Code

Artifact [58c0353de5]
Login

Artifact 58c0353de5ea6b07e0c6d7d9338c4f90767d85f8:

Attachment "head.patch" to ticket [1072654fff] added by dgp 2004-11-25 02:13:35.
Index: generic/tclCmdIL.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclCmdIL.c,v
retrieving revision 1.68
diff -u -r1.68 tclCmdIL.c
--- generic/tclCmdIL.c	31 Oct 2004 16:28:21 -0000	1.68
+++ generic/tclCmdIL.c	24 Nov 2004 19:09:28 -0000
@@ -1998,11 +1998,13 @@
 	    } else if ((nsPtr != globalNsPtr) && !specificNsInPattern) {
 		entryPtr = Tcl_FindHashEntry(&globalNsPtr->varTable,
 			simplePattern);
-		varPtr = (Var *) Tcl_GetHashValue(entryPtr);
-		if (!TclIsVarUndefined(varPtr)
-			|| TclIsVarNamespaceVar(varPtr)) {
-		    Tcl_ListObjAppendElement(interp, listPtr,
-			    Tcl_NewStringObj(simplePattern, -1));
+		if (entryPtr != NULL) {
+		    varPtr = (Var *) Tcl_GetHashValue(entryPtr);
+		    if (!TclIsVarUndefined(varPtr)
+			    || TclIsVarNamespaceVar(varPtr)) {
+			Tcl_ListObjAppendElement(interp, listPtr,
+				Tcl_NewStringObj(simplePattern, -1));
+		    }
 		}
 	    }
 	} else {
Index: tests/info.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/info.test,v
retrieving revision 1.28
diff -u -r1.28 info.test
--- tests/info.test	31 Oct 2004 16:28:21 -0000	1.28
+++ tests/info.test	24 Nov 2004 19:09:32 -0000
@@ -602,6 +602,14 @@
     }
     t1
 } {a}
+test info-19.6 {info vars: Bug 1072654} -setup {
+    namespace eval :: unset -nocomplain foo
+    catch {namespace delete x}
+} -body {
+    namespace eval x info vars foo
+} -cleanup {
+    namespace delete x
+} -result {}
 
 # Check whether the extra testing functions are defined...
 if {([catch {expr T1()} msg] == 1) && ($msg == {unknown math function "T1"})} {