Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2005-07-29
21:58 • Closed ticket [1247135fff]: info globals works wrong inside proc plus 7 othe... artifact: f25e2d3fd6 user: dkf
05:23 • Ticket [1247135fff]: 4 changes artifact: 0c9751c713 user: dgp
05:23 • Ticket [1247135fff]: 1 change artifact: 1b9a44d172 user: dgp
05:17 • Ticket [1247135fff]: 4 changes artifact: 35051ff78f user: dgp
2005-07-28
21:48 • New ticket [1247135fff]. artifact: 7b153192ce user: nobody

info globals works wrong inside proc

Closed / Fixed1247135fffffffffffffffffffffffffffffffffCreated 21 years agoUpdated 21 years ago
Descriptionplain2005-07-28 21:48:56
Name: Lawrence D'Oliveiro
Contact e-mail: [email protected]

Systems tried: SuSE Linux 9.3 x86-64, tcl 8.4.9-7 vs SuSE 9.1 
x86 (32-bit), tcl 8.4.6-26

On the system running 8.4.9, "info globals" is returning a 
nonempty result for an undefined global, when it should be 
returning an empty result. Furthermore, it only does this inside a 
proc.

For example, try this command sequence from the tclsh command 
prompt:

   proc Try {} {global Glob; info globals Glob}
   Try

Assuming that there is no global variable named "Glob", this 
returns an empty result on 8.4.6, but it returns "Glob" on 8.4.9.

If you try the same commands as the procedure body, entered 
directly:

   global Glob
   info globals Glob

This sequence returns an empty result on both 8.4.6 and 8.4.9.
dgpplain2005-07-29 05:17:48
Logged In: YES 
user_id=80530


This was a change in behavior
between releases 8.4.7 and 8.4.8.

The "changes" file says it's a fix for
Bug 1057461.  Or possibly a 
consequence  of  the
TclMatchIsTrivial() changes?
dgp Ticket [1247135fff]: 1 change [History diff]2005-07-29 05:23:00
dgpplain2005-07-29 05:23:01
Logged In: YES 
user_id=80530


Yes, it looks like the
TclIsVarUndefined() check
didn't get copied over to
the optimized version that
directly looks up trivial
patterns.
dkfplain2005-07-29 21:58:22
Logged In: YES 
user_id=79902

Fixed in HEAD and 8.4 branch
Log in (anonymous is fine) to add a comment.