summaryrefslogtreecommitdiffstats
path: root/generic/tclVar.c
diff options
context:
space:
mode:
authormig <mig@noemail.net>2011-04-13 13:23:45 (GMT)
committermig <mig@noemail.net>2011-04-13 13:23:45 (GMT)
commit67a5e1352058313b7b88b1d3e9c169913a12ab34 (patch)
tree087fd57082e97a3b84c1692414ad125c0ae45994 /generic/tclVar.c
parent37af6be5c74b7a6eff6382f6931fb0e5dd1a1449 (diff)
parent5e43510e0d6879db665866f7f8dd2031a07ee075 (diff)
downloadtcl-67a5e1352058313b7b88b1d3e9c169913a12ab34.zip
tcl-67a5e1352058313b7b88b1d3e9c169913a12ab34.tar.gz
tcl-67a5e1352058313b7b88b1d3e9c169913a12ab34.tar.bz2
fix for [Bug 2662380], crash caused by appending to a variable with a write trace that unsets it
FossilOrigin-Name: d58030af16c9a95571aa18275ff7e0448c980190
Diffstat (limited to 'generic/tclVar.c')
-rw-r--r--generic/tclVar.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 28151c0..b735ba3 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -2670,13 +2670,14 @@ Tcl_AppendObjCmd(
/*
* Note that we do not need to increase the refCount of the Var
* pointers: should a trace delete the variable, the return value
- * of TclPtrSetVar will be NULL, and we will not access the
- * variable again.
+ * of TclPtrSetVar will be NULL or emptyObjPtr, and we will not
+ * access the variable again.
*/
varValuePtr = TclPtrSetVar(interp, varPtr, arrayPtr, objv[1],
NULL, objv[i], TCL_APPEND_VALUE|TCL_LEAVE_ERR_MSG, -1);
- if (varValuePtr == NULL) {
+ if ((varValuePtr == NULL) ||
+ (varValuePtr == ((Interp *) interp)->emptyObjPtr)) {
return TCL_ERROR;
}
}