Skip to content
Tcl Source Code Artifact [f2917dab5c]
Login

Artifact [f2917dab5c]

Artifact f2917dab5ce354f9f7cea05976f851fcb3f8be0f:

Ticket change [f2917dab5c] - Ticket [456892ffffffffff|456892ffff] <i>Tcl_AppendStringsToObj -&gt; abort</i> status still Open with 4 other changes by msofer on 2001-08-31 08:33:55.
D 2001-08-31T08:33:55
J icomment Logged\sIn:\sYES\s\nuser_id=148712\n\nThis\sseems\sto\sbe\san\sunfortunate\scombination\sof\stwo\ssemi-bugs\n(aka\noptimisations?):\s\n\s\s\n1\s-\sTclCompileScript\s(tclCompile.c,\sll.\s838)\sjust\sPOPs\sthe\nprevious\ncommand\sresult\sfrom\sthe\sstack\sbut\sdoes\snot\sreset\sthe\ninterp's\nresult.\sThis\sis\sOK\sas\s(in\sprinciple)\sbcc'ed\scommands\ncommunicate\stheir\s\s\nresults\son\sthe\sstack\sand\sdo\snot\sset\sthe\sinterp's\sresult.\nCompare\sthis\nto\sclearing\sthe\sresult\sbefore\seach\sinvocation\sof\sa\scommand\nor\nevaluation\sof\sa\sscript.\n\n2\s-\sSome\serror\smessages\sare\s*appended*\sto\sthe\sinterp's\nresult.\sThis\sis\nnecessary\sfor\sthe\sbuildup\sof\sthe\serror\scall\sstack,\sbut\sI\nthink\sthe\ninterp's\sresult\sshould\sbe\sreset\sby\sthe\serror\s*originators*\n(in\sthese\nexamples,\sTclGetIntForIndex)\sbefore\sappending.\n\nI\swould\ssay\sthat\s#2\sshould\sbe\shunted\sdown,\s#1\sis\svaluable.\nAs\sa\ngeneral\srule,\scommands\sand\sfunctions\sshould\snot\sassume\sthat\nthey\sget\nan\sempty\sresult\swhen\sthey\sare\scalled;\sthey\sshould\sset\sthe\nresult,\snot\nappend\sto\sit.\n\n-----\nAdditionally:\n"set\sr\s[list]"\striggers\sa\score\sdump\sbecause\sit\sleaves\sa\nshared\sobject\nin\sthe\sinterp's\sresult:\sthe\ssame\sobject\sis\sthe\svalue\sof\sr.\nThe\nfollowing\sfunction\sbehaves\scorrectly\n\nproc\stst2\s{}\s{\n\s\s\s\sset\sr\sr[list]\n\s\s\s\slindex\sa\sa\n}\n\nNote\sthat\sif\syou\s*force*\sother\scommands\sto\scommunicate\svia\nthe\sinterp's\s\nresult,\syou\sreproduce\sthe\sbehaviour:\sthe\sfollowing\sdumps\ncore\stoo\n\nproc\stst3\s{}\s{\n\s\s\s\sset\sset\sset\n\s\s\s\s$set\sr\s5\n\s\s\s\slindex\sa\sa\n}\n\n----\nIN\sCONCLUSION:\n\n(a)\sthis\sparticular\sbug\sis\sfixed\sby\sresetting\sthe\sinterp's\nresult\sin\nTclGetIntForIndex.\s\n\n(b)\sthere\smay\sbe\sother\ssimilar\sbugs\slurking\sin\sthe\nbackground,\swaiting\nto\strip\sthe\sunwary;\sa\shunt\sfor\sfunctions\sabusingly\sappending\nto\sthe\nresult\swithout\sfirst\sresetting\sit\sfirst\sshould\sbe\sdone.\n\n
J login msofer
J mimetype text/plain
J username msofer
K 456892ffffffffffffffffffffffffffffffffff
U msofer
Z d60e82c9d211e71700227ecdd7c50499