summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2010-03-17 16:35:40 (GMT)
committerandreas_kupries <akupries@shaw.ca>2010-03-17 16:35:40 (GMT)
commit5d7a1c17873ac12e80410c4cf4fef6ace21565f6 (patch)
treedfdcaaa61a49d34ef382c0b90bb0a91fe6c009ab /generic/tclIO.c
parent0cf955ab149d4c4221bdafaaab80d53352ac4446 (diff)
downloadtcl-5d7a1c17873ac12e80410c4cf4fef6ace21565f6.zip
tcl-5d7a1c17873ac12e80410c4cf4fef6ace21565f6.tar.gz
tcl-5d7a1c17873ac12e80410c4cf4fef6ace21565f6.tar.bz2
* generic/tclIORTrans.c (ReflectInput, ReflectOutput,
ReflectSeekWide): [Bug 2921116]: Added missing TclEventuallyFree calls for preserved ReflectedTransform* structures. Reworked ReflectInput to preserve the structure for its whole life, not only in InvokeTclMethod. * generic/tclIO.c (Tcl_GetsObj): [Bug 2921116]: Regenerate topChan, may have been changed by a self-modifying transformation. * tests/ioTrans/test (iortrans-4.8, iortrans-4.9, iortrans-5.11, iortrans-7.4, iortrans-8.3): New test cases.
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r--generic/tclIO.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 7ed714c..bc94bb6 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIO.c,v 1.172 2010/02/24 10:45:04 dkf Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.173 2010/03/17 16:35:42 andreas_kupries Exp $
*/
#include "tclInt.h"
@@ -4715,6 +4715,13 @@ Tcl_GetsObj(
*/
gotEOL:
+ /*
+ * Regenerate the top channel, in case it was changed due to
+ * self-modifying reflected transforms.
+ */
+
+ chanPtr = statePtr->topChanPtr;
+
bufPtr = gs.bufPtr;
if (bufPtr == NULL) {
Tcl_Panic("Tcl_GetsObj: gotEOL reached with bufPtr==NULL");
@@ -4743,6 +4750,13 @@ Tcl_GetsObj(
*/
restore:
+ /*
+ * Regenerate the top channel, in case it was changed due to
+ * self-modifying reflected transforms.
+ */
+
+ chanPtr = statePtr->topChanPtr;
+
bufPtr = statePtr->inQueueHead;
if (bufPtr == NULL) {
Tcl_Panic("Tcl_GetsObj: restore reached with bufPtr==NULL");
@@ -4778,6 +4792,13 @@ Tcl_GetsObj(
*/
done:
+ /*
+ * Regenerate the top channel, in case it was changed due to
+ * self-modifying reflected transforms.
+ */
+
+ chanPtr = statePtr->topChanPtr;
+
UpdateInterest(chanPtr);
return copiedTotal;
}
@@ -5776,6 +5797,13 @@ DoReadChars(
*/
done:
+ /*
+ * Regenerate the top channel, in case it was changed due to
+ * self-modifying reflected transforms.
+ */
+
+ chanPtr = statePtr->topChanPtr;
+
UpdateInterest(chanPtr);
return copied;
}