Skip to content
Tcl Source Code Artifact [7dae16dbfb]
Login

Artifact [7dae16dbfb]

Artifact 7dae16dbfb425df7d3174e2a4433f4dd3094f793:

Ticket change [7dae16dbfb] - Ticket [633204ffffffffff|633204ffff] <i>catch { return foo } breaks inside proc </i> status still Open with 4 other changes by msofer on 2002-12-17 02:47:30.
D 2002-12-17T02:47:30
J icomment Logged\sIn:\sYES\s\nuser_id=148712\n\nWhen\scompiling\sthe\sbody\sof\s'a',\sthe\scompiler\sencounters\sa\nbcc'ed\scommand\s'catch\sand\sproceeds\sto\scompile\sits\sarguments;\nas\sthey\sare\salso\sbcc'ed\s('return'),\sthe\swhole\sthing\sgets\ncompiled\sinto\sthe\sbody\sof\s'a'.\n\nWhen\scompiling\s'b',\sthe\scompiler\sencounters\sa\snon-bcc'ed\ncommand\s'myreturn',\sand\scompiles\san\sinvocation\sfor\sit.\n\nThe\seffect\sat\sruntime\sis:\sthe\s'return'\sof\s'a'\sexecutes\sin\nthe\ssame\sTEBC\sinstance\sas\sthe\sproc\sbody,\sthere\sis\sno\nC-return\sinvolved.\sOTOH,\sthe\sreturn\sof\s'b'\scomes\sfrom\sa\nchild\sinstance\sof\sTEBC,\svia\sa\sreal\sC-return.\n\nThe\sinternal\sreturn\sin\sthe\sfirst\scase\scannot\sbe\shandled\sin\nthe\ssame\smanner:\sas\sit\sessentially\sexecutes\sin\sthe\ssame\nprocess,\sthe\sreturn\svalue\sof\san\sinlined\s'retun\s-code\s$x'\n*has*\sto\sbe\s$x\sfor\s(almost)\severything\sto\swork\sas\sit\sshould\n-\sthe\sexception\sbeing\swhat\swe're\stalking\sabout\shere\s:(\n\nI\simagine\sthings\scould\sconceivably\sbe\srepaired,\sbut\sat\sa\nhigh\scomplexity\scost\sin\sthe\scompiler:\sthe\sreturn-compiler\ncould\scheck\sif\sit\sis\scompiling\swithin\sa\scatch-range\sor\snot,\nand\scompile-in\sthe\scorrect\sreturn\scode:\sTCL_OK\sif\sit\sis\snot\ncaught,\sTCL_RETURN\sotherwise.\sNew\sidea,\sI'll\sthink\sabout\nthat\s...\n
J login msofer
J mimetype text/plain
J username msofer
K 633204ffffffffffffffffffffffffffffffffff
U msofer
Z c968da25d91fb4ccfc09c0e538f7fe92