summaryrefslogtreecommitdiffstats
path: root/generic/tclListObj.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-09-12 15:18:46 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-09-12 15:18:46 (GMT)
commited8604f566febdc366bae97f8d431a20612b3bfb (patch)
treee57748f5befcd157efdb55e14a31b2968ae3e909 /generic/tclListObj.c
parentbbcc51539b6cbb04bdee6c87c3f321d0f47d583b (diff)
downloadtcl-ed8604f566febdc366bae97f8d431a20612b3bfb.zip
tcl-ed8604f566febdc366bae97f8d431a20612b3bfb.tar.gz
tcl-ed8604f566febdc366bae97f8d431a20612b3bfb.tar.bz2
Make sure ListObjAppendElement invalidates outdated intreps.
Diffstat (limited to 'generic/tclListObj.c')
-rw-r--r--generic/tclListObj.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index c33b95e..fc253cc 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -711,6 +711,10 @@ Tcl_ListObjAppendElement(
listRepPtr = newPtr;
}
ListResetIntRep(listPtr, listRepPtr);
+ listRepPtr->refCount++;
+ TclFreeIntRep(listPtr);
+ ListSetIntRep(listPtr, listRepPtr);
+ listRepPtr->refCount--;
/*
* Add objPtr to the end of listPtr's array of element pointers. Increment