diff options
author | dgp <dgp@users.sourceforge.net> | 2014-02-06 22:48:34 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-02-06 22:48:34 (GMT) |
commit | 5c88f32139644538542058b07833e3731af7be18 (patch) | |
tree | aeb499092f019306364aa6075eab104c484306f5 /tests | |
parent | 1d139334be18bced5b3d4d6b1117e47696032f07 (diff) | |
parent | 32a6fce0618ed21d85cf47b4b842ea9ee2c0c2e6 (diff) | |
download | tcl-5c88f32139644538542058b07833e3731af7be18.zip tcl-5c88f32139644538542058b07833e3731af7be18.tar.gz tcl-5c88f32139644538542058b07833e3731af7be18.tar.bz2 |
[a4494e28ed] Use flag bit instead of NULL pointer to suppress
teardown list of imported commands when the original command
gets re-created. This prevents the panic otherwise possible when
the invalid state represented by the NULL pointer is encountered
during a command delete trace.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/namespace.test | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/namespace.test b/tests/namespace.test index f6688f1..8c4b81c 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -558,6 +558,15 @@ test namespace-13.1 {DeleteImportedCmd, deletes imported cmds} { lappend l [info commands ::test_ns_import::*] } } {::test_ns_import::cmd1 {}} +test namespace-13.2 {DeleteImportedCmd, Bug a4494e28ed} { + # Will panic if still buggy + namespace eval src {namespace export foo; proc foo {} {}} + namespace eval dst {namespace import [namespace parent]::src::foo} + trace add command src::foo delete \ + "[list namespace delete [namespace current]::dst] ;#" + proc src::foo {} {} + namespace delete src +} {} test namespace-14.1 {TclGetNamespaceForQualName, absolute names} { catch {namespace delete {*}[namespace children :: test_ns_*]} |