summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-03-28 21:24:22 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-03-28 21:24:22 (GMT)
commit20baf86d1e03655bb6d7fae562091e95fe52db15 (patch)
tree450c7ea2350bd2ac42208d372730066b2f0317bf /generic/tclEncoding.c
parent43308bf3c516fbe56b41a2d8e4ea948c63603b3e (diff)
downloadtcl-20baf86d1e03655bb6d7fae562091e95fe52db15.zip
tcl-20baf86d1e03655bb6d7fae562091e95fe52db15.tar.gz
tcl-20baf86d1e03655bb6d7fae562091e95fe52db15.tar.bz2
The DupEncodingIntRep() routine is broken. It fails to set the typePtr
field of the duplicated Tcl_Obj to indicate that the intrep is that of the &encodingType. The impact must be that refcounting of Tcl_Encodings are out of balance, at least in the (unusual?) case where "encoding" values need duplication. I hesitate to actually commit this fix until I have a test demonstrating the need for it, and a chance to see the impact on actual encoding operations. The lifetime management of encodings has a history of being tricky and raising controversy. More work required.
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 4edebcf..32055a3 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -355,6 +355,7 @@ DupEncodingIntRep(
Tcl_Obj *dupPtr)
{
dupPtr->internalRep.twoPtrValue.ptr1 = Tcl_GetEncoding(NULL, srcPtr->bytes);
+ dupPtr->typePtr = &encodingType;
}
/*