Skip to content
Tcl Source Code History Of Ticket 2383005
Login

History Of Ticket 2383005

Artifacts Associated With Ticket 2383005

  1. Ticket change [313f51e793] (rid 93391) by dgp on 2008-12-03 15:00:39:

    1. assignee initialized to: "dgp"
    2. cmimetype initialized to: "text/plain"
    3. 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.
      
      
    4. foundin initialized to: "obsolete: 8.5.5"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "dgp"
    10. subsystem initialized to: "45. Parsing and Eval"
    11. title initialized to: "return -errorcode accepts non-list argument"
    12. type initialized to: "Bug"
  2. Ticket change [b986d96322] (rid 129164) by dgp on 2010-03-17 21:07:28:

    1. assignee changed to: "ferrieux"
    2. priority changed to: "9 Immediate"
  3. Ticket change [7892045191] (rid 89981) by ferrieux on 2010-03-18 06:06:45:

    1. 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.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  4. Ticket change [55ba8bf5b6] (rid 94198) by ferrieux on 2010-03-18 06:07:21:

    1. icomment:
      
      
      File Added - 367184: return_errorcode.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  5. Ticket change [cde50ee436] (rid 95966) by ferrieux on 2010-03-18 06:41:51:

    1. 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 ?
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  6. Ticket change [da5205e57e] (rid 107754) by dgp on 2010-03-19 03:52:52:

    1. icomment:
      
      As noted in the original report, I think
      the place to fix this is in TclMergeReturnOptions(),
      not in TclProcessReturn().
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  7. Ticket change [c6e5276b85] (rid 121849) by ferrieux on 2010-03-19 05:43:57:

    1. icomment:
      D'oh of course :)
      Attaching patch, please review.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  8. Ticket change [77e0af6bf9] (rid 89847) by ferrieux on 2010-03-19 05:44:50:

    1. icomment:
      
      
      File Added - 367318: errorcode.patch
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  9. Add attachment "errorcode.patch" [595c8b8e08] (rid 117966) by ferrieux on 2010-03-19 05:44:50.

  10. Ticket change [cff4a431d9] (rid 113079) by ferrieux on 2010-03-19 05:45:04:

    1. icomment:
      
      
      File Deleted - 367184: 
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  11. Ticket change [e1d9715b19] (rid 87524) by dgp on 2010-03-24 22:29:28:

    1. assignee changed to: "dgp"
    2. closedate changed to: "2010-03-24T15:29:28"
    3. closer changed to: "dgp"
    4. 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.
      
      
      
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"
    9. username: "dgp"