diff options
-rw-r--r-- | generic/tclBasic.c | 3 | ||||
-rw-r--r-- | generic/tclInt.h | 1 | ||||
-rw-r--r-- | tests/chanio.test | 1 | ||||
-rw-r--r-- | tests/io.test | 1 | ||||
-rw-r--r-- | tests/namespace.test | 43 |
5 files changed, 48 insertions, 1 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 9efbd85..4ee2ca0 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -3617,6 +3617,7 @@ Tcl_DeleteCommandFromToken( * TclNRExecuteByteCode looks up the command in the command hashtable). */ + cmdPtr->flags |= CMD_DEAD; TclCleanupCommandMacro(cmdPtr); return 0; } @@ -4686,7 +4687,7 @@ EvalObjvCore( * Caller gave it to us. */ - if (!(preCmdPtr->flags & CMD_IS_DELETED)) { + if (!(preCmdPtr->flags & CMD_DEAD)) { /* * So long as it exists, use it. */ diff --git a/generic/tclInt.h b/generic/tclInt.h index c3801ee..dcac9e8 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -1734,6 +1734,7 @@ typedef struct Command { #define CMD_COMPILES_EXPANDED 0x08 #define CMD_REDEF_IN_PROGRESS 0x10 #define CMD_VIA_RESOLVER 0x20 +#define CMD_DEAD 0x30 /* diff --git a/tests/chanio.test b/tests/chanio.test index a0169f1..46a0c06 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -5733,6 +5733,7 @@ test chan-io-46.1 {Tcl event loop vs multiple interpreters} {testfevent fileeven set timer [after 10 lappend x timeout] testfevent cmd $script vwait x + after cancel $timer testfevent cmd {chan close $f} list [testfevent cmd {set x}] [testfevent cmd {info commands after}] } {{f triggered: foo bar} after} diff --git a/tests/io.test b/tests/io.test index 7a83994..c78492b 100644 --- a/tests/io.test +++ b/tests/io.test @@ -6100,6 +6100,7 @@ test io-46.1 {Tcl event loop vs multiple interpreters} {testfevent fileevent} { set timer [after 10 lappend x timeout] testfevent cmd $script vwait x + after cancel $timer testfevent cmd {close $f} list [testfevent cmd {set x}] [testfevent cmd {info commands after}] } {{f triggered: foo bar} after} diff --git a/tests/namespace.test b/tests/namespace.test index 0d93092..ad24fce 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -3337,6 +3337,49 @@ test namespace-56.5 {Bug 8b9854c3d8} -setup { namespace delete namespace-56.5 } -result 1 + + +test namespace-57.0 { + an imported alias should be usable in the deletion trace for the alias + + see 29e8848eb976 +} -body { + variable res {} + namespace eval ns2 { + namespace export * + proc p1 {oldname newname op} { + return success + } + + interp alias {} [namespace current]::p2 {} [namespace which p1] + } + + + namespace eval ns3 { + namespace import ::ns2::p2 + } + + + set ondelete [list apply [list {oldname newname op} { + variable res + catch { + ns3::p2 $oldname $newname $op + } cres + lappend res $cres + } [namespace current]]] + + + trace add command ::ns2::p2 delete $ondelete + rename ns2::p2 {} + return $res +} -cleanup { + unset res + namespace delete ns2 + namespace delete ns3 +} -result success + + + # cleanup catch {rename cmd1 {}} |