summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2007-09-10 23:05:45 (GMT)
committerhobbs <hobbs>2007-09-10 23:05:45 (GMT)
commit0d3e2f0116da21f2c52ef225148e17555d4be6ff (patch)
treeabef9c4169cc4c9e0c5f789af2bc9e95fc0147b2
parent6726323860d0fd2b135fac517b16af7e6f03dfc7 (diff)
downloadtcl-0d3e2f0116da21f2c52ef225148e17555d4be6ff.zip
tcl-0d3e2f0116da21f2c52ef225148e17555d4be6ff.tar.gz
tcl-0d3e2f0116da21f2c52ef225148e17555d4be6ff.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 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;
+ }
}
/*