summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2019-11-14 20:07:37 (GMT)
committersebres <sebres@users.sourceforge.net>2019-11-14 20:07:37 (GMT)
commitc28a047f8ac27cc47e0e47578bddc491c72bd9ae (patch)
treea3e9259888ba0d928d86dd24b994c835fe053c6c
parent0cb2dc120b35cf286c565c683a271710aad03f5f (diff)
parent4a0d55e4c90514af7ad345fdc8a3e5c54100197c (diff)
downloadtcl-c28a047f8ac27cc47e0e47578bddc491c72bd9ae.zip
tcl-c28a047f8ac27cc47e0e47578bddc491c72bd9ae.tar.gz
tcl-c28a047f8ac27cc47e0e47578bddc491c72bd9ae.tar.bz2
merge 8.6
-rw-r--r--generic/tclOOMethod.c8
-rw-r--r--tests/io.test2
-rw-r--r--tests/oo.test29
3 files changed, 35 insertions, 4 deletions
diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c
index 78421e1..88782dd 100644
--- a/generic/tclOOMethod.c
+++ b/generic/tclOOMethod.c
@@ -679,11 +679,13 @@ InvokeProcedureMethod(
* call frame's lifetime). */
/*
- * If the interpreter was deleted, we just skip to the next thing in the
- * chain.
+ * If the object namespace (or interpreter) were deleted, we just skip to
+ * the next thing in the chain.
*/
- if (Tcl_InterpDeleted(interp)) {
+ if (!((CallContext *)context)->oPtr->namespacePtr ||
+ Tcl_InterpDeleted(interp)
+ ) {
return TclNRObjectContextInvokeNext(interp, context, objc, objv,
Tcl_ObjectContextSkippedArgs(context));
}
diff --git a/tests/io.test b/tests/io.test
index 519191f..73481ca 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -7447,7 +7447,7 @@ test io-53.3 {CopyData: background read underflow} {stdio unix openpipe fcopy} {
close $f
set result
} "ready line1 line2 {done\n}"
-test io-53.4 {CopyData: background write overflow} {stdio unix openpipe fileevent fcopy} {
+test io-53.4 {CopyData: background write overflow} {stdio openpipe fileevent fcopy} {
set big bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n
variable x
for {set x 0} {$x < 12} {incr x} {
diff --git a/tests/oo.test b/tests/oo.test
index c8f4b21..235a90d 100644
--- a/tests/oo.test
+++ b/tests/oo.test
@@ -1422,6 +1422,35 @@ test oo-7.9 {OO: defining inheritance in namespaces} -setup {
return
}
} -result {}
+test oo-7.10 {OO: next after object deletion, bug [135804138e]} -setup {
+ set ::result ""
+ oo::class create c1 {
+ method m1 {} {
+ lappend ::result c1::m1
+ }
+ }
+ oo::class create c2 {
+ superclass c1
+ destructor {
+ lappend ::result c2::destructor
+ my m1
+ lappend ::result /c2::destructor
+ }
+ method m1 {} {
+ lappend ::result c2::m1
+ rename [self] {}
+ lappend ::result no-self
+ next
+ lappend ::result /c2::m1
+ }
+ }
+} -body {
+ c2 create o
+ lappend ::result [catch {o m1} msg] $msg
+} -cleanup {
+ c1 destroy
+ unset ::result
+} -result {c2::m1 c2::destructor c2::m1 no-self c1::m1 /c2::m1 /c2::destructor no-self 1 {no next method implementation}}
test oo-8.1 {OO: global must work in methods} {
oo::object create foo