summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclCmdIL.c14
-rw-r--r--tests/info.test10
3 files changed, 22 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 2c1e364..8516164 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-11-24 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tclCmdIL.c (InfoVarsCmd): Corrected segfault in new
+ * tests/info.test (info-19.6): trivial matching branch [Bug 1072654]
+
2004-11-24 Donal K. Fellows <donal.k.fellows@man.ac.uk>
* tools/man2html.tcl, tools/man2html1.tcl: Update to use Tcl 8.4.
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index 9d5c829..660ceb5 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -15,7 +15,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdIL.c,v 1.68 2004/10/31 16:28:21 dkf Exp $
+ * RCS: @(#) $Id: tclCmdIL.c,v 1.69 2004/11/24 19:28:41 dgp Exp $
*/
#include "tclInt.h"
@@ -1998,11 +1998,13 @@ InfoVarsCmd(dummy, interp, objc, objv)
} 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 {
diff --git a/tests/info.test b/tests/info.test
index a5343fe..b3e777e 100644
--- a/tests/info.test
+++ b/tests/info.test
@@ -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: info.test,v 1.28 2004/10/31 16:28:21 dkf Exp $
+# RCS: @(#) $Id: info.test,v 1.29 2004/11/24 19:28:42 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -602,6 +602,14 @@ test info-19.5 {info vars with temporary variables} {
}
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"})} {