Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#4838 Tcl_LinkVar should prevent duplicates

obsolete: 8.5.9
closed-fixed
Don Porter
5
2011-06-21
2011-06-16
Don Porter
No

The whole tclLink.c file relies on a constraint
that a Tcl variable is only linked to one C variable
at a time. However, Tcl_LinkVar() does nothing
to detect and prevent violations of this constraint.

Detection is easy. Prevention could take two
forms. Either raise an error, or let the second
Tcl_LinkVar() call on the same Tcl variable
implicitly Tcl_UnlinkVar() any previous link that's
already in place.

Discussion

  • Since changing the link's target sounds highly unlikely, flag it as an error.

     
  • Don Porter
    Don Porter
    2011-06-21

    fix committed.

     
  • Don Porter
    Don Porter
    2011-06-21

    • assigned_to: hobbs --> dgp
    • status: open --> closed-fixed