Overview
| Artifact ID: | 26a97aee1fab9feac27c2f6e908e1b6f22473569 |
|---|---|
| Ticket: | 2865247fffffffffffffffffffffffffffffffff
C version of [try] assumes return -level 0 |
| User & Date: | a_kovalenko on 2009-09-23 20:34:00 |
Changes
- assignee changed to: "dkf"
- cmimetype changed to: "text/plain"
- comment changed to:
Try this on CVS head: proc mumu {} { try { return -level 3 123} finally {} } catch mumu rv ro it gives 0 as result, -code 0 -level 0 as $ro and on tcl 8.6b1 it gives (rightly) 2 as result, -code 0 -level 2 as $ro The problem is caused by using TclProcessReturn in the C [try] implementation. TclProcessReturn expects -code and -level from the options to be the same as code and level passed as parameters. [try] implementation, on the other hand, passes constant 0 as level, and it may be wrong. Proposed solution is to use Tcl_SetReturnOptions instead of TclProcessReturn in [try] implementation. I think it's the best of available alternatives, because it's symmetric to Tcl_GetReturnOptions call that is used to obtain these options in the first place. Diff is attached. - foundin changed to: "obsolete: 8.6b1"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "a_kovalenko"
- subsystem changed to: "18. Commands M-Z"
- title changed to: "C version of [try] assumes return -level 0"
- type changed to: "Bug"