Tcl Source Code

View Ticket
Login
Ticket UUID: 1590232
Title: error in cmd traces & aliases
Type: Bug Version: obsolete: 8.5a6
Submitter: msofer Created on: 2006-11-03 23:14:19
Subsystem: 45. Parsing and Eval Assigned To: msofer
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2006-11-04 06:25:56
Resolution: Fixed Closed By: msofer
    Closed on: 2006-11-03 23:25:56
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
:: ::
User Comments: msofer added on 2006-11-04 06:14:19:

File Added - 201334: trace.patch

Attachments: