summaryrefslogtreecommitdiffstats
path: root/generic/tclLink.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2007-09-10 23:06:10 (GMT)
committerhobbs <hobbs>2007-09-10 23:06:10 (GMT)
commit3d0363d75132bc2ec9d634940b92aec189807073 (patch)
treef286c5900d326f5cdffbb81c9637be9822bf622c /generic/tclLink.c
parentf20f61673b5f52bb6282fa6ec33adb68ee449b8d (diff)
downloadtcl-3d0363d75132bc2ec9d634940b92aec189807073.zip
tcl-3d0363d75132bc2ec9d634940b92aec189807073.tar.gz
tcl-3d0363d75132bc2ec9d634940b92aec189807073.tar.bz2
* generic/tclLink.c (Tcl_UpdateLinkedVar): guard against var being
unlinked. [Bug 1740631] (maros)
Diffstat (limited to 'generic/tclLink.c')
-rw-r--r--generic/tclLink.c11
1 files changed, 9 insertions, 2 deletions
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;
+ }
}
/*