Skip to content
Tcl Source Code Artifact [46abe8b2d1]
Login

Artifact [46abe8b2d1]

Artifact 46abe8b2d103be46d93a34eca2525fda8f90d733:

Ticket change [46abe8b2d1] - Ticket [483611ffffffffff|483611ffff] <i>codePtr-&gt;maxStackDepth badly computed</i> status still Open with 4 other changes by msofer on 2001-12-10 19:27:15.
D 2001-12-10T19:27:15
J icomment \n\nFile\sAdded\s-\s14437:\sfixLevels2.patch\n\nLogged\sIn:\sYES\s\nuser_id=148712\n\nA\snew\spatch\s(fixLevels2.patch)\sthat\scomputes\sthe\stcl\nrequired\sstack\salmost\sperfectly\s(see\sbelow),\sdoes\sit\nautomatically\sfor\scode\swith\sno\sjumps\sand\sis\snot\smore\nexpensive\sthan\sthe\soriginal\simplementation.\sThe\spatch\salso\nincludes\sthe\stesting\scode\s(effective\sunder\nTCL_COMPILE_DEBUG)\sof\svalidate.patch.\n\nThe\sway\sit\sworks\sis:\n\n1.\sthe\sinstruction\sdescription\stable\sgot\sa\snew\sint\sfield\nstackEffect,\spopulated\sat\sthe\sstart\sof\stclCompile.c\n\n2.\sthe\smacros\sthat\spush\sinstructions\s(in\stclCompile.h)\salso\nmanage\sthe\sdepth\scount.\sThe\scomputations\sare\scorrect\sfor\nlinear\scode;\scommands\sthat\shave\snon-linear\sflow\shave\sto\stake\ncare\sto\sset\sthe\snew\sfield\senvPtr->currStackLevel\scorrectly\nat\sthe\sstart\sof\seach\sbasic\sblock.\n\n3.\sthe\scompile\sprocs\sin\s(tclCompCmds.c,\stclCompExpr.c)\sfor\nall\scommands\sthat\semit\sjumps\swere\sadapted:\nTclCompileCatchCmd,\sTclCompileForCmd,\sTclCompileForeachCmd,\nTclCompileIfCmd,\sTclCompileWhileCmd,\sCompileLandOrLorExpr,\nCompileCondExpr.\s\n\nThe\sstack\sbalance\sof\stwo\sinstructions\sis\soverestimated:\n\s\s-\scallBuiltinFunc1\sis\sset\sto\shave\sa\sstack\sbalance\sof\s+1,\ncorresponding\sto\sinbuilt\smath\sfunctions\swith\sno\sarguments;\nthe\scorrect\sis\s(1-numArgs).\n\s\s-\slindexMulti\sis\sset\sto\shave\sa\sstack\sbalance\sof\s(1-opnd)\ninstead\sof\sthe\scorrect\s(-opnd).\sThis\sis\sthe\sonly\sinstruction\nthat\shas\sthe\sstack\sbalance\s"coded"\sin\sthe\sfirst\soperand\nwhere\sthe\sformula\s(1-opnd)\sis\snot\scorrect\s...\n\nBoth\scould\sbe\scorrected,\sat\sthe\scost\sof\sa\sslight\scode\ncomplication.\sAs\soverestimates\sare\ssafe,\sthis\swas\snot\sdeemed\nnecessary.\n
J login msofer
J mimetype text/plain
J username msofer
K 483611ffffffffffffffffffffffffffffffffff
U msofer
Z f2e3677a730c1de693a56e8c77d20ed9