diff options
author | dgp <dgp@users.sourceforge.net> | 2016-07-15 16:17:15 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2016-07-15 16:17:15 (GMT) |
commit | 101ba49d21013886c3cddefb69b1c58750b5beb2 (patch) | |
tree | f89cbfac7ced7d47efdc680939371f3c4678c450 /generic/tclObj.c | |
parent | a9b978e18f2c975faf0ac3b3ff821317a0625fce (diff) | |
download | tcl-101ba49d21013886c3cddefb69b1c58750b5beb2.zip tcl-101ba49d21013886c3cddefb69b1c58750b5beb2.tar.gz tcl-101ba49d21013886c3cddefb69b1c58750b5beb2.tar.bz2 |
First really crude step toward a fix is to just completely disable the
intreps of the "cmdName" Tcl_ObjType. No caches means no invalid caches.
This provides a baseline of correct, but possibly unacceptably slow behavior.
The strange thing is that there's not an immediately dramatic slowdown that
I perceive. Will be interested in experiences to the contrary.
Diffstat (limited to 'generic/tclObj.c')
-rw-r--r-- | generic/tclObj.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/generic/tclObj.c b/generic/tclObj.c index b145d7e..dc6175a 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -4131,6 +4131,7 @@ Tcl_GetCommandFromObj( * global namespace. */ { register ResolvedCmdName *resPtr; + Tcl_Command result = NULL; /* * Get the internal representation, converting to a command type if @@ -4176,11 +4177,14 @@ Tcl_GetCommandFromObj( */ /* See [07d13d99b0a9] why we cannot call SetCmdNameFromAny() directly here. */ - if (tclCmdNameType.setFromAnyProc(interp, objPtr) != TCL_OK) { - return NULL; + if (tclCmdNameType.setFromAnyProc(interp, objPtr) == TCL_OK) { + resPtr = objPtr->internalRep.twoPtrValue.ptr1; + if (resPtr) { + result = (Tcl_Command) resPtr->cmdPtr; + } + TclFreeIntRep(objPtr); } - resPtr = objPtr->internalRep.twoPtrValue.ptr1; - return (Tcl_Command) (resPtr ? resPtr->cmdPtr : NULL); + return result; } /* @@ -4268,6 +4272,7 @@ TclSetCmdNameObj( if (objPtr->typePtr == &tclCmdNameType) { return; } + return; SetCmdNameObj(interp, objPtr, cmdPtr, NULL); } |