summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclLink.c11
2 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 48fc551..5276c37 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-09-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tclLink.c (Tcl_UpdateLinkedVar): guard against var being
+ unlinked. [Bug 1740631] (maros)
+
2007-09-10 Miguel Sofer <msofer@users.sf.net>
* generic/tclCompile.c: fix tclInstructionTable entry for
diff --git a/generic/tclLink.c b/generic/tclLink.c
index 0f33c03..59eb70f 100644
--- a/generic/tclLink.c
+++ b/generic/tclLink.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclLink.c,v 1.22 2007/05/07 19:45:33 dgp Exp $
+ * RCS: @(#) $Id: tclLink.c,v 1.23 2007/09/10 23:05:46 hobbs Exp $
*/
#include "tclInt.h"
@@ -215,7 +215,14 @@ Tcl_UpdateLinkedVar(
linkPtr->flags |= LINK_BEING_UPDATED;
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
TCL_GLOBAL_ONLY);
- linkPtr->flags = (linkPtr->flags & ~LINK_BEING_UPDATED) | savedFlag;
+ /*
+ * Callback may have unlinked the variable. [Bug 1740631]
+ */
+ linkPtr = (Link *) Tcl_VarTraceInfo(interp, varName, TCL_GLOBAL_ONLY,
+ LinkTraceProc, (ClientData) NULL);
+ if (linkPtr != NULL) {
+ linkPtr->flags = (linkPtr->flags & ~LINK_BEING_UPDATED) | savedFlag;
+ }
}
/*