<i>Regression with TIP #636 in foreach</i> status still Open with 3 other changes
by
.
D 2023-07-12T03:34:16.667
J icomment What\shappened?\r\n\r\n\s\s\s*\sCanvas\swidget\sdefines\san\soption\stable\sthe\sincludes\sthe\sstring\s"coords"\r\n\s\s\s*\sTestcase\shas:\s"foreach\scoord\s$pixelCoords\s{..."\r\n\s\s\s*\sInternal\sto\sthe\sforeach\scommand,\sa\scopy\sof\sthe\svariable\sargument\sis\smade\susing\sTclDuplicatePureObj().\r\n\s\s\s*\sThe\s"coord"\sargument\sends\sup\sas\sa\sshared\sObj\swith\sa\stype\sof\s"index"\sObjType.\s\r\n\s\s\s\s\s\s*\s(this\sis\sdue\sto\suse\sof\san\sabbreviated\s"coord"\skeyword\sto\sa\scanvas\scommand\ssomewhere\sin\san\searlier\stest.\sProbably\shundreds\sof\sthem.)\r\n\s\s\s*\sThe\sinternal\srep\smatches\sthe\s"coords"\svalue\sin\sthe\scanvas\soption\stable.\r\n\s\s\s*\sThe\sDup-Pure\sremoves\sthe\sstring\srep,\sleaving\sthe\s"index"\sObjType\sinternal\srep.\r\n\s\s\s*\sThe\svar\slookup\scode\srequests\sthe\sstring,\swhich\sis\sgenerated\sfrom\sthe\soption\stable,\sand\sreturns\s"coords"\r\n\s\s\s*\sThe\slookup\sfails\sbecause\sthe\svariable\sname\sis\s"coord".\r\n\r\nTake\saway:\r\n\r\n\s\s\s*\sI\sthink\sTclDuplicatePureObj()\sis\sdangerous.\sUses\sshould\sbe\sinspected\scarefully.\r\n\s\s\s*\sI\sthink\sthe\soption\stable\simplementation\sis\sviolating\sconsistency\spromise\sbetween\sinternal\srep\sand\sstring\srep.\r\n\r\nThis\sissue\shas\sbeen\sfixed\sby\sreplacing\sTclDuplicatePureObj\swith\sTcl_DuplicateObj().\sIn\sthis\scase,\sthe\svalues\sare\svar\snames.\sIt's\sall\sabout\sthe\sstring\shere.
J login griffin
J mimetype text/x-markdown
K a34733451b2cf189528061944466cf7ce7015008
U griffin
Z f39beb4fd76797219a7a917466a491b9