Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 744572fd6793b076b52c46734619e558ab6ab432dad2a3a875241148e4c21f99
Ticket: 4f6a1ebd64cffa3ef795d83cb15d92c40cfb12bd
ensemble: segmentation fault when -subcommand and -map values are the same object
User & Date: sebres on 2017-11-28 21:28:23
Changes

  1. closer changed to: "nobody"
  2. foundin changed to: ">= 8.5"
  3. icomment:
    > Is there a reason TclListCopy() did not figure in the solution here?
    
    In my opinion this is anyway too hard to duplicate a list/dict in such obscure case (normally it would be enough to use construct as below to say it is in the dict instead of search in the dict):
    ```
    if (!(i & 1) && i < subcmdc-1) {
        target = subcmdv[i+1];
    } else {
        target = NULL;
    }
    ```
    But unfortunately there is another obscure case (map used quasi as filtering):
    ```
    proc ::two {} {return 2}
    proc ::three {} {return 3}
    set list {one ::two one ::three}
    namespace ensemble configure n -subcommands $lst -map $lst
    
    % n one
    3
    ```
    
    But I've another own branch where ensembles map/list handling rewritten, and this case with duplication is fixed there. I'll try to rebase it here.
    
    Additionally I reopen this because currently all versions (supported ensembles) are affected.
    ATM fixed for core-8-branch only, I'll provide new one for 8.5 and if accepted reintegrate it for all versions (8.5 and higher).
    The test case is cherry-picked as is.
    
  4. login: "sebres"
  5. mimetype: "text/plain"
  6. status changed to: "Open"