summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authormig <mig>2011-04-13 13:19:36 (GMT)
committermig <mig>2011-04-13 13:19:36 (GMT)
commit15b046014e5863f3e8e8d4275b46feb2bdfdbf98 (patch)
tree50deca2ecd704224e4a4b8b3630167516f3ef751 /generic
parentce6fbd8bb9c3fd5c8a26e3bc71ea22d0679fbd91 (diff)
downloadtcl-15b046014e5863f3e8e8d4275b46feb2bdfdbf98.zip
tcl-15b046014e5863f3e8e8d4275b46feb2bdfdbf98.tar.gz
tcl-15b046014e5863f3e8e8d4275b46feb2bdfdbf98.tar.bz2
fix for [Bug 2662380], crash caused by appending to a variable with a write trace that unsets it
Diffstat (limited to 'generic')
-rw-r--r--generic/tclVar.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 9815469..a1885b5 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -2554,13 +2554,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;
}
}