summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-09-07 18:49:55 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-09-07 18:49:55 (GMT)
commit43be762ef2c9161d87dcddea3d78084c7c077903 (patch)
tree531f5aa3ec5d823c5a4d62ea1142497ec962b581
parent86d682b82273fd98a4259df86f4303bc65a896b6 (diff)
parent76023565adb6e64816efbf4cae39b1c5d2ab725a (diff)
downloadtcl-43be762ef2c9161d87dcddea3d78084c7c077903.zip
tcl-43be762ef2c9161d87dcddea3d78084c7c077903.tar.gz
tcl-43be762ef2c9161d87dcddea3d78084c7c077903.tar.bz2
Partial revert of [a16752c252] bug fix to stop crashes in buggy tclcompiler.
-rw-r--r--generic/tclBasic.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 314b5fc..c3ab871 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -1967,7 +1967,8 @@ Tcl_CreateCommand(
*
* Side effects:
* If a command named "cmdName" already exists for interp, it is
- * first deleted. Then the new command is created from the arguments.
+ * first deleted. Then the new command is created from the arguments.
+ * [***] (See below for exception).
*
* In the future, during bytecode evaluation when "cmdName" is seen as
* the name of a command by Tcl_EvalObj or Tcl_Eval, the object-based
@@ -2034,8 +2035,27 @@ Tcl_CreateObjCommand(
if (!isNew) {
cmdPtr = Tcl_GetHashValue(hPtr);
+ /* Command already exists. */
+
+ /*
+ * [***] This is wrong. See Tcl Bug a16752c252.
+ * However, this buggy behavior is kept under particular
+ * circumstances to accommodate deployed binaries of the
+ * "tclcompiler" program. http://sourceforge.net/projects/tclpro/
+ * that crash if the bug is fixed.
+ */
+
+ if (cmdPtr->objProc == TclInvokeStringCommand
+ && cmdPtr->clientData == clientData
+ && cmdPtr->deleteData == clientData
+ && cmdPtr->deleteProc == deleteProc) {
+ cmdPtr->objProc = proc;
+ cmdPtr->objClientData = clientData;
+ return (Tcl_Command) cmdPtr;
+ }
+
/*
- * Command already exists; delete it. Be careful to preserve any
+ * Otherwise, we delete the old command. Be careful to preserve any
* existing import links so we can restore them down below. That way,
* you can redefine a command and its import status will remain
* intact.