summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2007-09-10 23:06:10 (GMT)
committerhobbs <hobbs>2007-09-10 23:06:10 (GMT)
commit4b59eed7e9ef54634aa4bf2c3114d2dbe63ca846 (patch)
treef286c5900d326f5cdffbb81c9637be9822bf622c
parentc5502f2f5dd95ce494975824aee1679f3a09bf5a (diff)
downloadtcl-4b59eed7e9ef54634aa4bf2c3114d2dbe63ca846.zip
tcl-4b59eed7e9ef54634aa4bf2c3114d2dbe63ca846.tar.gz
tcl-4b59eed7e9ef54634aa4bf2c3114d2dbe63ca846.tar.bz2
* generic/tclLink.c (Tcl_UpdateLinkedVar): guard against var being
unlinked. [Bug 1740631] (maros)
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclLink.c11
2 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index fda9215..0b6fd69 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-08-25 Kevin Kenny <kennykb@acm.org>
* generic/tclClock.c (FormatClock): Claimed additional space for
diff --git a/generic/tclLink.c b/generic/tclLink.c
index 3cbaebb..f9cfc70 100644
--- a/generic/tclLink.c
+++ b/generic/tclLink.c
@@ -13,7 +13,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.8.2.2 2007/05/10 18:23:58 dgp Exp $
+ * RCS: @(#) $Id: tclLink.c,v 1.8.2.3 2007/09/10 23:06:12 hobbs Exp $
*/
#include "tclInt.h"
@@ -206,7 +206,14 @@ Tcl_UpdateLinkedVar(interp, varName)
Tcl_IncrRefCount(objPtr);
Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, objPtr, TCL_GLOBAL_ONLY);
Tcl_DecrRefCount(objPtr);
- 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;
+ }
}
/*