Overview
| Artifact ID: | 0dbbeb49466135ac7a6497e21248401c7009cea2 |
|---|---|
| Ticket: | b9b2079e6d23fb18b7944fbb4b703223cff6ec44
Segfaults parsing a script. The script works nicely in version 8.5 |
| User & Date: | anonymous on 2016-03-08 18:27:18 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
This is the most simplified code I have been able to write triggering the segfault. It crashes in 32 and 64 bit versions of tcl (debian sid package) ------ #!/bin/tclsh foreach i {a b} {set t_$i ""} proc triggerError {} { set var_t "" foreach i {a b} { set v t_$i upvar 1 [coalesce [set var_t] [set v]] t_$i } } proc coalesce {args} { set res "" foreach i $args { if {$i != ""} {set res $i;break} } return $res } triggerError puts "END" ------ I think the problem has something to do with the parsing of line 9 (the one with the upvar). If you change it like this: set aux [coalesce [set var_t] [set v]] upvar 1 $aux t_$i The problem fades away. - foundin changed to: "8.6.5"
- is_private changed to: "0"
- login: "anonymous"
- priority changed to: "5 Medium"
- private_contact changed to: "3ff3943d55f2767d3dd1d11b625e46c3cc9479b2"
- resolution changed to: "None"
- severity changed to: "Severe"
- status changed to: "Open"
- submitter changed to: "anonymous"
- subsystem changed to: "45. Parsing and Eval"
- title changed to:
Segfaults parsing a script. The script works nicely in version 8.5
- type changed to: "Bug"