Skip to content
Tcl Source Code View Ticket
Login

View Ticket

error in cmd traces & aliases

Closed / Fixed1590232fffffffffffffffffffffffffffffffffCreated 20 years agoUpdated 20 years ago
Descriptionplain2006-11-03 23:14:19
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
:: ::
msoferplain2006-11-04 06:14:19
File Added - 201334: trace.patch
msofer Closed ticket [1590232fff]. [History diff]2006-11-04 06:25:56
Log in (anonymous is fine) to add a comment.

Attachments: