diff options
author | dgp <dgp@users.sourceforge.net> | 2017-09-12 15:44:00 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2017-09-12 15:44:00 (GMT) |
commit | 3776406b3c44c21f00b87384f81e559047f3a4fe (patch) | |
tree | 6ddacf0f390dfa8414e6f23532d6d7ca48235628 /generic | |
parent | 0c7e022b49b03f12c730da8b08d31969b09f28c8 (diff) | |
download | tcl-3776406b3c44c21f00b87384f81e559047f3a4fe.zip tcl-3776406b3c44c21f00b87384f81e559047f3a4fe.tar.gz tcl-3776406b3c44c21f00b87384f81e559047f3a4fe.tar.bz2 |
Make sure ListObjReplace invalidates outdated intreps.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclListObj.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c index fc253cc..f60329d 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -1127,10 +1127,15 @@ Tcl_ListObjReplace( listRepPtr->elemCount = numRequired; /* - * Invalidate and free any old string representation since it no longer - * reflects the list's internal representation. + * Invalidate and free any old representations that may not agree + * with the revised list's internal representation. */ + listRepPtr->refCount++; + TclFreeIntRep(listPtr); + ListSetIntRep(listPtr, listRepPtr); + listRepPtr->refCount--; + TclInvalidateStringRep(listPtr); return TCL_OK; } |