|
2005-12-19
| ||
| 05:42 | • Closed ticket [1382528fff]: dict for {k v} $emptyDict crashes plus 7 other c... artifact: 5c1d197f17 user: dkf | |
|
2005-12-16
| ||
| 23:58 | • Add attachment dict-for.patch to ticket [1382528fff] artifact: 96524ce8cf user: a_kovalenko | |
| 23:58 | • Ticket [1382528fff] dict for {k v} $emptyDict crashes status still Open with... artifact: 35b839f83d user: a_kovalenko | |
| 23:58 | • Ticket [1382528fff]: 4 changes artifact: 52458a3c81 user: a_kovalenko | |
| 23:48 | • Ticket [1382528fff]: 4 changes artifact: a89962b712 user: a_kovalenko | |
| 23:00 | • Ticket [1382528fff]: 5 changes artifact: 9be5991004 user: dkf | |
| 23:00 | • Ticket [1382528fff]: 2 changes artifact: fce90f4ff3 user: dkf | |
| 15:55 | • New ticket [1382528fff]. artifact: 88adf6aaae user: a_kovalenko | |
dict for {k v} $emptyDict crashes
Closed / Fixed1382528fffffffffffffffffffffffffffffffffCreated 21 years agoUpdated 21 years ago
Descriptionplain2005-12-16 15:55:16
Test case:
proc bad {} {
dict for {k v} {} {}
catch {whoops}
}
bad
causes segfault (linux), access violation (windows).
The crash itself appears in TclStackFree (when
decrementing refcount), but seems to be related with
Tcl_DictObjFirst / Tcl_DictObjDone behavior with empty
values.
dkf Ticket [1382528fff]: 2 changes
[History diff]2005-12-16 23:00:14
dkfplain2005-12-16 23:00:15
Logged In: YES user_id=79902 Only happens in compiled [dict for].
a_kovalenkoplain2005-12-16 23:48:18
Logged In: YES user_id=241496 I know. The problem is in exception ranges: beginCatch bytecode is not reached with empty dicts, but endCatch is.
a_kovalenkoplain2005-12-16 23:58:54
Logged In: YES user_id=241496 The patch solving this problem is attached. beginCatch is now emitted before the first JumpTrue.
a_kovalenkoplain2005-12-16 23:58:55
File Added - 160100: dict-for.patch
dkfplain2005-12-19 05:42:40
Logged In: YES user_id=79902 I'm not going with that because it is likely to inhibit future bytecode optimizations. Instead, I've split the code so that the handling of loop-exit is different from the handling of loop-never-entered. This is a few instructions longer, but probably faster. BTW, thanks for spotting that it was a problem with the management of the catch stack; I was stumped!
Log in (anonymous is fine) to add a comment.
Attachments:
- dict-for.patch [download] added by a_kovalenko on 2005-12-16 23:58:55. [details]