Skip to content
Tcl Source Code Artifact [4441a7cbdc]
Login

Artifact [4441a7cbdc]

Artifact 4441a7cbdc67a3cdbfd2ba2f3d0cfa6ea9ca77fa3a74d116803aca803b881c1b:

Ticket change [4441a7cbdc] - Ticket [4eb3a155ac6f73f4|4eb3a155ac] <i>apply causes memory corruption / crash</i> status still Open with 3 other changes by apnadkarni on 2022-07-23 04:30:17.
D 2022-07-23T04:30:17.839
J icomment *Comments\sfrom\ssebres\son\sthe\schat:*\r\n\r\n<sebres>:\sapn:\snice\scatch...\sjust\sas\sfor\sthe\sfix\s[072cffce6f]\s-\sit\sis\sa\sbit\stoo\sheavy,\sI\smean\salways\sto\sshimmer\sto\spure\sstring\sbody\s(for\sinstance\sit'd\snever\suse\sa\slist\seval,\sif\sbody\sis\slist),\salso\scould\slost\ssome\slarge\sobject\sinternal\srepresentations\s(apply\s[list\sargs\s[list\s...\s$largeObj]]),\sand\swould\sneed\sto\srecreate\sit\sby\sthe\sevaluation\se.\sg.\sshimmer\sback\sto\sexpected\stype)\r\n\r\n<sebres>:\sapn:\sisn't\spossible\sto\scorrect\sprocPtr->numCompiledLocals\sor\seven\sforce\sthat\srecompilation\sonly\sin\scase\swhere\sit\sis\swrong\s(we\sassuming\sinvocation\sof\sbyteCode\svs.\slambda/proc\sbyteCode)?\r\n\r\n*My\sresponse\son\sthe\schat:*\r\n\r\n@sebres,\sregarding\s[072cffce6f],\sI\swas\sjust\sglad\sI\swas\snot\scompletely\soff-track\sa\sfew\sdays\sago\swhen\sI\slogged\sa\sbogus\sticket\sabout\sbug\sin\sapply!\sRegarding\sthe\sfix,\smy\sfirst\sthought\shad\sbeen\sthat\sit\smight\sbe\spotentially\sheavyweight\sas\syou\ssay\s\sbecause\sof\sthe\sinternal\srep\sbeing\sdiscarded.\sBut\sthen\srethinking,\sI\sconcluded\sany\sinternal\srep\sis\sgoing\sto\sget\sshimmered\sto\sa\sByteCode\sobject\sanyways\swhen\sthe\sscript\s(in\sbodyPtr)\sis\scompiled\sby\sTclCompileScript.\sSo\sit\sis\sonly\sbeing\sdiscarded\sa\slittle\searlier.\s\sThis\swas\sthe\scleanest\ssolution\sI\scould\sfind\sbut\sthis\sis\smy\sforay\sinto\sthe\sbyte\scode\sworld\sso\sI\scould\sbe\swrong\sabout\sthat.\r\n\r\nIt\sis\salso\sa\srare\scase\sthat\sthe\slambda\sobject\sdoes\snot\shave\sa\sinternal\sLambda\srepresentation\sbut\sthe\sbody\sobject\shas\san\sinternal\sByteCode\srepresentation.\r\n\r\n"apn:\sisn't\spossible\sto\scorrect\sprocPtr->numCompiledLocals\sor\seven\sforce\sthat\srecompilation\sonly\sin\scase\swhere\sit\sis\swrong\s(we\sassuming\sinvocation\sof\sbyteCode\svs.\slambda/proc\sbyteCode)?"\s-\sI\swent\sdown\sthat\spath\stoo\s(have\sbody\sstore\sthat\svalue\sand\supdate\sprocPtr\sin\sthe\scase\sthe\sbody\sis\snot\srecompiled)\sbut\sbeyond\smy\sabilities\sat\sthis\stime.\sI'm\snot\ssure\swhat\sother\sside\seffects\sthe\sbody\scompilation\shas\sand\swhat\selse\smight\sneed\sto\sbe\sfixed/restored.
J login apnadkarni
J mimetype text/x-markdown
K 4eb3a155ac6f73f48b270a19e543841d26bf2e6f
U apnadkarni
Z 67ae08368bb29a63fa4de870de334eaf