diff options
author | hobbs <hobbs@noemail.net> | 2007-09-10 23:06:10 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2007-09-10 23:06:10 (GMT) |
commit | 18813d4054fc09e848d6f861f692a19a1bb61c85 (patch) | |
tree | f286c5900d326f5cdffbb81c9637be9822bf622c /generic/tclLink.c | |
parent | cf79d204294f9bbc17ba97f1920f9a1cfc60dc32 (diff) | |
download | tcl-18813d4054fc09e848d6f861f692a19a1bb61c85.zip tcl-18813d4054fc09e848d6f861f692a19a1bb61c85.tar.gz tcl-18813d4054fc09e848d6f861f692a19a1bb61c85.tar.bz2 |
* generic/tclLink.c (Tcl_UpdateLinkedVar): guard against var being
unlinked. [Bug 1740631] (maros)
FossilOrigin-Name: 1ae99dbfd25fe27ff3e6bcb9b983d71f89ef026e
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; + } } /* |