Description: |
Aliases resolve command names in the global namespace,
but execute in the caller's scope. In the presence of
traces that cause a second resolution, the second time
the resolution proceeds in caller scope instead of global:
mig@ice:~$ cat /tmp/trace
set res {}
proc x {} {return ::}
namespace eval a {}
proc a::x {} {return ::a}
interp alias {} y {} x
lappend res [namespace eval a y]
trace add execution x enter {
rename ::x {}
proc ::x {} {return ::}
#}
lappend res [namespace eval a y]
puts $res
mig@ice:~$ /home/CVS/tcl8.5a5/unix/tclsh /tmp/trace
:: ::a
Correct behaviour is restored with the attached patch,
returning
:: ::
|