diff options
author | hobbs <hobbs> | 2007-09-10 23:06:10 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2007-09-10 23:06:10 (GMT) |
commit | 4b59eed7e9ef54634aa4bf2c3114d2dbe63ca846 (patch) | |
tree | f286c5900d326f5cdffbb81c9637be9822bf622c /generic/tclLink.c | |
parent | c5502f2f5dd95ce494975824aee1679f3a09bf5a (diff) | |
download | tcl-4b59eed7e9ef54634aa4bf2c3114d2dbe63ca846.zip tcl-4b59eed7e9ef54634aa4bf2c3114d2dbe63ca846.tar.gz tcl-4b59eed7e9ef54634aa4bf2c3114d2dbe63ca846.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.c | 11 |
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; + } } /* |