diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | generic/tclCmdIL.c | 27 |
2 files changed, 25 insertions, 9 deletions
@@ -1,3 +1,10 @@ +2008-06-12 Andreas Kupries <andreask@activestate.com> + + * generic/tclCmdIL.c (InfoFrameCmd): TIP #280 conditional + feature. Added checks to validate HashEntry and HashTable + information gotten from Command structures. This seems to be + needed to handle structures managed by Itcl. + 2008-06-12 Daniel Steffen <das@users.sourceforge.net> * unix/Makefile.in: add complete deps on tclDTrace.h. diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index eae2d10..d7f1d5b 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.12 2007/12/05 14:54:08 dkf Exp $ + * RCS: @(#) $Id: tclCmdIL.c,v 1.47.2.13 2008/06/12 20:19:29 andreas_kupries Exp $ */ #include "tclInt.h" @@ -1202,17 +1202,26 @@ InfoFrameCmd(dummy, interp, objc, objv) lv [lc ++] = Tcl_NewStringObj (f.cmd.str.cmd, f.cmd.str.len); if (procPtr != NULL) { - Tcl_HashEntry* namePtr = procPtr->cmdPtr->hPtr; - char* procName = Tcl_GetHashKey (namePtr->tablePtr, namePtr); - char* nsName = procPtr->cmdPtr->nsPtr->fullName; + Tcl_HashEntry* namePtr = procPtr->cmdPtr->hPtr; + /* + * ITcl seems to provide us with weird, maybe bogus + * Command structures (methods?) which may have no + * HashEntry pointing to the name information, or a + * HashEntry without owning HashTable. Therefore check + * again that our data is valid. + */ + if (namePtr && namePtr->tablePtr) { + char* procName = Tcl_GetHashKey (namePtr->tablePtr, namePtr); + char* nsName = procPtr->cmdPtr->nsPtr->fullName; - lv [lc ++] = Tcl_NewStringObj ("proc",-1); - lv [lc ++] = Tcl_NewStringObj (nsName,-1); + lv [lc ++] = Tcl_NewStringObj ("proc",-1); + lv [lc ++] = Tcl_NewStringObj (nsName,-1); - if (strcmp (nsName, "::") != 0) { - Tcl_AppendToObj (lv [lc-1], "::", -1); + if (strcmp (nsName, "::") != 0) { + Tcl_AppendToObj (lv [lc-1], "::", -1); + } + Tcl_AppendToObj (lv [lc-1], procName, -1); } - Tcl_AppendToObj (lv [lc-1], procName, -1); } break; } |