summaryrefslogtreecommitdiffstats
path: root/generic/tclVar.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclVar.c')
-rw-r--r--generic/tclVar.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 9815469..aaf1cb9 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;
}
}
@@ -4775,6 +4776,7 @@ FreeLocalVarName(
if (namePtr) {
Tcl_DecrRefCount(namePtr);
}
+ objPtr->typePtr = NULL;
}
static void
@@ -4816,6 +4818,7 @@ FreeNsVarName(
CleanupVar(varPtr, NULL);
}
}
+ objPtr->typePtr = NULL;
}
static void
@@ -4855,6 +4858,7 @@ FreeParsedVarName(
TclDecrRefCount(arrayPtr);
ckfree(elem);
}
+ objPtr->typePtr = NULL;
}
static void