|
2015-07-18
| ||
| 05:51 | • Ticket [3970f54c4e] regression in compiled unset status still Closed with ... artifact: 66cf4df695 user: dgp | |
|
2015-07-17
| ||
| 20:55 | • Ticket [3970f54c4e]: 4 changes artifact: 25e186766b user: dgp | |
| 20:30 | • Ticket [3970f54c4e]: 4 changes artifact: ed45f7a7ec user: dgp | |
| 19:40 | • Ticket [3970f54c4e]: 5 changes artifact: e2815d0c72 user: dgp | |
|
2013-09-19
| ||
| 22:43 | • Closed ticket [3970f54c4e]. artifact: 766124ecd0 user: dkf | |
| 22:37 | [3970f54c4e]: Improved fix that is more tolerant of a single variable varname. check-in: af5c35971a user: dkf tags: trunk | |
| 19:41 | • Ticket [3970f54c4e] regression in compiled unset status still Open with 6 ... artifact: 945c53f308 user: dkf | |
| 19:37 | [3970f54c4e]: Corrected regression in argument order processing in [unset]. check-in: 836d61598d user: dkf tags: trunk | |
| 19:10 | • Ticket [3970f54c4e] regression in compiled unset status still Open with 3 ... artifact: a858b7d030 user: dkf | |
| 18:44 | • Ticket [3970f54c4e]: 4 changes artifact: 1fbe5d914b user: dgp | |
| 18:07 | • New ticket [3970f54c4e]. artifact: e27779c41f user: dgp | |
regression in compiled [unset]
In Tcl 8.5:
% apply {{} {unset foo [return 1]}}
1
In Tcl 8.6(.1):
% apply {{} {unset foo [return 1]}}
can't unset "foo": no such variable
The compiler for [unset] is failing to
preserve substitution ordering rules.
af5c35971a[3970f54c4e]: Improved fix that is more tolerant of a single variable varname. check-in2013-09-19 22:37:06836d61598d[3970f54c4e]: Corrected regression in argument order processing in [unset]. check-in2013-09-19 19:37:05
Passing to the author of TclCompileUnsetCmd().
Yes, that was a bug. Sorted it by making the compiler stricter in what it handles, which shouldn't be a problem for most code.
I need to figure out a better way to handle what happens when unsetting a single variable with a non-literal specifying the name; that's a case which ought to work in principle, but which the current restriction stops. But in any case, current behavior is semantically correct; this doesn't block a release now.
Thinking about it, we can handle a single variable varName provided it is the first varName and either there was an option (-- or -nocomplain) beforehand, or the varName provably doesn't begin with a hyphen.
Determining the latter in the presence of a non-constant word is messy (check if you've got a TCL_TOKEN_WORD with a leading TCL_TOKEN_TEXT whose first char is a non-hyphen) as there's now convenient function for this. Nor would there be; it's specialised!
Applied this version. Still passes the test case, but also compiles unset foo($bar) fine (verified by disassembly).
Postscript: The compiled [unset foo($bar)] here is leaking memory. http://core.tcl.tk/tcl/tktview/a3309d01db
It appears that the handling of options is off as well, but that's hard to figure out because the handling is very poorly specified.
The direct eval and the compiled [unset] do not
agree on what this should mean:
unset -nocomplain --
Now they do again.