diff options
author | dgp <dgp@users.sourceforge.net> | 2004-11-24 19:28:08 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2004-11-24 19:28:08 (GMT) |
commit | 365126d4a4f8facef8165e398eb97402b286cc16 (patch) | |
tree | 450281e1b7e656ddb6d2b8570484ab4ab616c2d1 | |
parent | dcc1ed1129283a3f510297869024d755b7a2c17a (diff) | |
download | tcl-365126d4a4f8facef8165e398eb97402b286cc16.zip tcl-365126d4a4f8facef8165e398eb97402b286cc16.tar.gz tcl-365126d4a4f8facef8165e398eb97402b286cc16.tar.bz2 |
* generic/tclCmdIL.c (InfoVarsCmd): Corrected segfault in new
* tests/info.test (info-19.6): trivial matching branch [Bug 1072654]
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tclCmdIL.c | 14 | ||||
-rw-r--r-- | tests/info.test | 10 |
3 files changed, 22 insertions, 7 deletions
@@ -1,3 +1,8 @@ +2004-11-23 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-23 Vince Darley <vincentdarley@users.sourceforge.net> * generic/tclPathObj.c: fix and new test for [Bug 1043129] in diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 5951df7..283d842 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.47.2.4 2004/10/31 16:43:30 dkf Exp $ + * RCS: @(#) $Id: tclCmdIL.c,v 1.47.2.5 2004/11/24 19:28:12 dgp Exp $ */ #include "tclInt.h" @@ -1991,11 +1991,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) - || (varPtr->flags & VAR_NAMESPACE_VAR)) { - Tcl_ListObjAppendElement(interp, listPtr, - Tcl_NewStringObj(simplePattern, -1)); + if (entryPtr != NULL) { + varPtr = (Var *) Tcl_GetHashValue(entryPtr); + if (!TclIsVarUndefined(varPtr) + || (varPtr->flags & VAR_NAMESPACE_VAR)) { + Tcl_ListObjAppendElement(interp, listPtr, + Tcl_NewStringObj(simplePattern, -1)); + } } } } else { diff --git a/tests/info.test b/tests/info.test index 27e6edc..0f65324 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.24.2.2 2004/10/31 16:43:30 dkf Exp $ +# RCS: @(#) $Id: info.test,v 1.24.2.3 2004/11/24 19:28:13 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -608,6 +608,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"})} { |