Artifacts Associated With Ticket 2383005
Ticket change [313f51e793] (rid 93391) by dgp on 2008-12-03 15:00:39:
- assignee initialized to: "dgp"
- cmimetype initialized to: "text/plain"
- comment initialized to:
% string is list "not \{ a list" 0 % catch {return -code error -errorcode "not \{ a list"} m o 2 % set m % set o -errorcode not\ \{\ a\ list -code 1 -level 1 The documentation is clear in return.n that -errorcode option takes a list argument. TclMergeReturnOptions() is failing to check that. - foundin initialized to: "obsolete: 8.5.5"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "45. Parsing and Eval"
- title initialized to: "return -errorcode accepts non-list argument"
- type initialized to: "Bug"
Ticket change [b986d96322] (rid 129164) by dgp on 2010-03-17 21:07:28:
- assignee changed to: "ferrieux"
- priority changed to: "9 Immediate"
Ticket change [7892045191] (rid 89981) by ferrieux on 2010-03-18 06:06:45:
- icomment:
Tiny attached patch barfs on non-list passed to [return -errorcode]. However, the exact error message is still [return]'s main argument (since it is called with -code error), because the caller of TclProcessReturn sets the interp result later. Maybe some kind of signalling should be devised to tell it about this special situation.
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [55ba8bf5b6] (rid 94198) by ferrieux on 2010-03-18 06:07:21:
- icomment:
File Added - 367184: return_errorcode.patch
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [cde50ee436] (rid 95966) by ferrieux on 2010-03-18 06:41:51:
- icomment:
A simple way out would be in the non-compiled Tcl_ReturnObjCmd to exchange the two statements: code = TclProcessReturn(interp, code, level, returnOpts); if (explicitResult) { Tcl_SetObjResult(interp, objv[objc-1]); } yielding: if (explicitResult) { Tcl_SetObjResult(interp, objv[objc-1]); } code = TclProcessReturn(interp, code, level, returnOpts); however, doing the same in INST_RETURN_IMM in TEBC implies setting the result twice in the OK case (since the TOS ends up in the result), and I dare not (speed). Another option, as suggested before, is to add a high bit to TCL_ERROR, that would be intercepted immediately on return from TclProcessReturn, meaning TCL_ERROR_DURING_RETURN. Ugly too. Advice ? - login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [da5205e57e] (rid 107754) by dgp on 2010-03-19 03:52:52:
- icomment:
As noted in the original report, I think the place to fix this is in TclMergeReturnOptions(), not in TclProcessReturn().
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [c6e5276b85] (rid 121849) by ferrieux on 2010-03-19 05:43:57:
- icomment:
D'oh of course :) Attaching patch, please review.
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [77e0af6bf9] (rid 89847) by ferrieux on 2010-03-19 05:44:50:
- icomment:
File Added - 367318: errorcode.patch
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Add attachment "errorcode.patch" [595c8b8e08] (rid 117966) by ferrieux on 2010-03-19 05:44:50.
Ticket change [cff4a431d9] (rid 113079) by ferrieux on 2010-03-19 05:45:04:
- icomment:
File Deleted - 367184:
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [e1d9715b19] (rid 87524) by dgp on 2010-03-24 22:29:28:
- assignee changed to: "dgp"
- closedate changed to: "2010-03-24T15:29:28"
- closer changed to: "dgp"
- icomment:
allow_comments - 1 Thanks for the patch. Committing to 8.5 and HEAD changing only the SetErrorCode arguments to better match what's been done before.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dgp"