Skip to content
Tcl Source Code Artifact [29958c27be]
Login

Artifact [29958c27be]

Artifact 29958c27be56a4b52253f4bfa195a33ff2b527a0e501ac76f9593ac6df93a198:

Ticket change [29958c27be] - New ticket [56ab601b7dfd6490|56ab601b7d] <i>Canonical sign becomes wrong after list duplication resp. botched after build of string representation of the copy.</i>. by sebres on 2018-03-14 21:11:45.
D 2018-03-14T21:11:45.041
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment If\swe've\san\sobject\swith\sdefinitely\snot\scanonical\sform\sof\sstring\srepresentation,\s\r\nfor\sexample\s`originPtr`\swith\sstring\scontent\slike\s`a\s\s\sb`,\sso\sany\sin-place\s\r\nconversion\sof\sthis\sobject\sto\sthe\slist\sset\sthe\scanonicalFlag\sof\sthe\snew\screated\r\ninternal\slist\srepresentation\sto\s0.\r\nSo\sfar,\severything\sis\sOK.\r\n\r\nNow\ssomething\slike\sTclListObjCopy,\sDupListInternalRep,\setc,\sthat\sjust\scopies\s\r\nthe\sinternal\srepresentation\sof\sthis\slist,\swill\sbe\sexecuted,\sso\swe\shave\sanother\s\r\nobject\s`copyPtr`\swith\sthe\ssame\sinternal\slist\srepresentation\sas\s`originPtr`\s(with\s\r\nList::refCount\s==\s2\snow).\r\n\r\nThe\scanonicalFlag\sis\sstill\scorrect,\sbut\sevil\sis\salready\shappened.\r\n\r\nBecause\safter\scall\sof\ssomething\sexpected\sstring\srepresentation\sfor\sthis\sduplicate\r\n`copyPtr`\s(that\scalls\sUpdateStringOfList),\sthe\scanonicalFlag\sof\sthe\slist\sof\sthis\r\nobject\sgets\s1\s(actually\sof\sboth\sobjects)!\r\n\r\nThe\sproblem\sis\s-\sthis\slist\srepresentation\sis\s"shared"\sbetween\s`originPtr`\sand\s\r\n`copyPtr`,\sthus\sthe\scheck\susing\sListObjIsCanonical(originPtr)\sreturn\s1\snow.\r\n\r\nThe\sissue\sis\sbasically\spresent\sbecause\sthe\smember\scanonicalFlag\smust\sbelong\snot\s\r\nto\sthe\sList\sstructure,\sbut\sto\sthe\sTcl_Obj\s(e.\sg.\sas\ssecond\sint-rep\slike\sflags\sin\s\r\ninternalRep.ptrAndLongRep.value,\sso\scan\sbe\sdifferent\sacross\s`originPtr`\sand\s\r\n`copyPtr`\swith\sthe\ssame\s"shared"\sinternal\slist\srepresentation.\r\n\r\nUnfortunately\sit\schanges\sthe\sstructure\sof\sthe\slist\s(and\smacros),\sso\snot\sreally\sbackwards\scompatible\s(at\sleast\snot\sfor\scompiled\sbinaries).\s\r\nBut\sIMHO\sthis\sis\sthe\sproper\sway\sonly,\sto\sfix\sthis\sissue.
J foundin all
J is_private 0
J login sebres
J priority 5\sMedium
J resolution None
J severity Important
J status Open
J submitter sebres
J subsystem 14.\sList\sObject
J title Canonical\ssign\sbecomes\swrong\safter\slist\sduplication\sresp.\sbotched\safter\sbuild\sof\sstring\srepresentation\sof\sthe\scopy.
J type Bug
K 56ab601b7dfd649035e808fb85e024f60e02e280
U sebres
Z 95181be57dcc001aba15b7b251c12e1c