Overview
| Artifact ID: | 29958c27be56a4b52253f4bfa195a33ff2b527a0e501ac76f9593ac6df93a198 |
|---|---|
| Ticket: | 56ab601b7dfd649035e808fb85e024f60e02e280
Canonical sign becomes wrong after list duplication resp. botched after build of string representation of the copy. |
| User & Date: | sebres on 2018-03-14 21:11:45 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
If we've an object with definitely not canonical form of string representation, for example `originPtr` with string content like `a b`, so any in-place conversion of this object to the list set the canonicalFlag of the new created internal list representation to 0. So far, everything is OK. Now something like TclListObjCopy, DupListInternalRep, etc, that just copies the internal representation of this list, will be executed, so we have another object `copyPtr` with the same internal list representation as `originPtr` (with List::refCount == 2 now). The canonicalFlag is still correct, but evil is already happened. Because after call of something expected string representation for this duplicate `copyPtr` (that calls UpdateStringOfList), the canonicalFlag of the list of this object gets 1 (actually of both objects)! The problem is - this list representation is "shared" between `originPtr` and `copyPtr`, thus the check using ListObjIsCanonical(originPtr) return 1 now. The issue is basically present because the member canonicalFlag must belong not to the List structure, but to the Tcl_Obj (e. g. as second int-rep like flags in internalRep.ptrAndLongRep.value, so can be different across `originPtr` and `copyPtr` with the same "shared" internal list representation. Unfortunately it changes the structure of the list (and macros), so not really backwards compatible (at least not for compiled binaries). But IMHO this is the proper way only, to fix this issue.
- foundin changed to: "all"
- is_private changed to: "0"
- login: "sebres"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Important"
- status changed to: "Open"
- submitter changed to: "sebres"
- subsystem changed to: "14. List Object"
- title changed to:
Canonical sign becomes wrong after list duplication resp. botched after build of string representation of the copy.
- type changed to: "Bug"