summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-05-09 17:46:45 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-05-09 17:46:45 (GMT)
commitf3283e67a3037b34b0a3811bab9e09333c13d8f4 (patch)
treebacf44f260810bea56e8860043d991e4ae62bb30
parent8e7747599e225b9ef8650e9fd0426318978db316 (diff)
downloadtcl-f3283e67a3037b34b0a3811bab9e09333c13d8f4.zip
tcl-f3283e67a3037b34b0a3811bab9e09333c13d8f4.tar.gz
tcl-f3283e67a3037b34b0a3811bab9e09333c13d8f4.tar.bz2
Repair another "impossible" test and the segfault it reveals.
-rw-r--r--generic/tclIORTrans.c2
-rw-r--r--tests/ioTrans.test10
2 files changed, 7 insertions, 5 deletions
diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c
index 1de635f..1dff4b3 100644
--- a/generic/tclIORTrans.c
+++ b/generic/tclIORTrans.c
@@ -2010,6 +2010,7 @@ InvokeTclMethod(
sr = Tcl_SaveInterpState(rtPtr->interp, 0 /* Dummy */);
Tcl_Preserve(rtPtr);
+ Tcl_Preserve(rtPtr->interp);
result = Tcl_EvalObjv(rtPtr->interp, cmdc, rtPtr->argv, TCL_EVAL_GLOBAL);
/*
@@ -2054,6 +2055,7 @@ InvokeTclMethod(
Tcl_IncrRefCount(resObj);
}
Tcl_RestoreInterpState(rtPtr->interp, sr);
+ Tcl_Release(rtPtr->interp);
Tcl_Release(rtPtr);
/*
diff --git a/tests/ioTrans.test b/tests/ioTrans.test
index 7f4f7f0..c40621b 100644
--- a/tests/ioTrans.test
+++ b/tests/ioTrans.test
@@ -1034,7 +1034,7 @@ test iortrans-11.1 {origin interpreter of moved transform destroyed during acces
# Magic to get the test* commands in the slaves
load {} Tcltest $ida
load {} Tcltest $idb
-} -constraints {testchannel impossible} -match glob -body {
+} -constraints {testchannel} -match glob -body {
# Set up channel in thread
set chan [interp eval $ida $helperscript]
set chan [interp eval $ida {
@@ -1042,14 +1042,14 @@ test iortrans-11.1 {origin interpreter of moved transform destroyed during acces
handle.initialize clear drain flush limit? read write
handle.finalize
lappend ::res $args
- # Destroy interpreter during channel access. Actually not
- # possible for an interp to destroy itself.
- interp delete {}
- return}
+ # Destroy interpreter during channel access.
+ suicide
+ }
set chan [chan push [tempchan] foo]
fconfigure $chan -buffering none
set chan
}]
+ interp alias $ida suicide {} interp delete $ida
# Move channel to 2nd thread, transform goes with it.
interp eval $ida [list testchannel cut $chan]
interp eval $idb [list testchannel splice $chan]