Skip to content
Tcl Source Code Artifact [a962864558]
Login

Artifact [a962864558]

Artifact a96286455861bc01ec4f2215f7aaa599ed869ed2:

Ticket change [a962864558] - New ticket [218529ffffffffff|218529ffff] <i>compiler emits bad code for &quot;if&quot; expressions: crash in &quot;set </i>. by nobody on 2000-10-26 01:01:46.
D 2000-10-26T01:01:46
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s898\sBug\nVersion:\s8.0.5\nSubmitDate:\s'1998-12-03'\nLastModified:\s'1999-04-16'\nSeverity:\sCRIT\nStatus:\sReleased\nSubmitter:\sadmin\nChangedBy:\sstanton\nOS:\sAll\nOSVersion:\sNA\nMachine:\sNA\nFixedDate:\s'1999-04-16'\nFixedInVersion:\s8.1b3\nClosedDate:\s'2000-10-25'\n\n\nReproducibleScript:\n\nrunning\sthe\sfollowing\sscript\swill\scause\sa\sseg\sfault\sor\ssome\ssuch.\n\n\n\s\sset\sx\s{{0}}\n\n\s\swhile\s{1}\s{\n\n\s\s\s\sif\s!$x\s{puts\syes}\n\n\s\s}\n\n\nwhat\shappens\sis\sthe\sbytecode\sinterpreter\soverruns\sthe\scatch\sstack,\sbecause\sthe\scompiled\scode\sis\smissing\san\sendCatch.\n\n\nPatch:\n\nIndex:\stclCompile.c\n\n===================================================================\n\nRCS\sfile:\s/cvsroot/tcl/generic/tclCompile.c,v\n\nretrieving\srevision\s1.11\n\ndiff\s-c\s-p\s-r1.11\stclCompile.c\n\n***\stclCompile.c1998/09/14\s18:39:581.11\n\n---\stclCompile.c1998/11/27\s03:04:26\n\n***************\n\n***\s5,11\s****\n\n\s\s\s*of\scommands\s(like\squoted\sstrings\sor\snested\ssub-commands)\sinto\sa\n\n\s\s\s*sequence\sof\sinstructions\s("bytecodes").\s\n\n\s\s\s*\n\n!\s\s*\sCopyright\s(c)\s1996-1997\sSun\sMicrosystems,\sInc.\n\n\s\s\s*\n\n\s\s\s*\sSee\sthe\sfile\s"license.terms"\sfor\sinformation\son\susage\sand\sredistribution\n\n\s\s\s*\sof\sthis\sfile,\sand\sfor\sa\sDISCLAIMER\sOF\sALL\sWARRANTIES.\n\n---\s5,11\s----\n\n\s\s\s*of\scommands\s(like\squoted\sstrings\sor\snested\ssub-commands)\sinto\sa\n\n\s\s\s*sequence\sof\sinstructions\s("bytecodes").\s\n\n\s\s\s*\n\n!\s\s*\sCopyright\s(c)\s1996-1998\sSun\sMicrosystems,\sInc.\n\n\s\s\s*\n\n\s\s\s*\sSee\sthe\sfile\s"license.terms"\sfor\sinformation\son\susage\sand\sredistribution\n\n\s\s\s*\sof\sthis\sfile,\sand\sfor\sa\sDISCLAIMER\sOF\sALL\sWARRANTIES.\n\n***************\sCompileExprWord(interp,\sstring,\slastChar\n\n***\s6321,6329\s****\n\n\s\senvPtr->excRangeArrayNext\s=\sstartRangeNext;\n\n\s\sinlineCode\s=\s0;\n\n\s\s\s\s\s\s}\selse\s{\n\n!\sTclEmitOpcode(INST_END_CATCH,\senvPtr);\n\n\s\sTclEmitForwardJump(envPtr,\sTCL_UNCONDITIONAL_JUMP,\s&jumpFixup);\n\n\s\senvPtr->excRangeArrayPtr[range].catchOffset\s=\sTclCurrCodeOffset();\n\n\s\s\s\s\s\s}\n\n\s\s}\n\n\n---\s6321,6330\s----\n\n\s\senvPtr->excRangeArrayNext\s=\sstartRangeNext;\n\n\s\sinlineCode\s=\s0;\n\n\s\s\s\s\s\s}\selse\s{\n\n!\sTclEmitOpcode(INST_END_CATCH,\senvPtr);\s/*\sfor\sok\scase\s*/\n\n\s\sTclEmitForwardJump(envPtr,\sTCL_UNCONDITIONAL_JUMP,\s&jumpFixup);\n\n\s\senvPtr->excRangeArrayPtr[range].catchOffset\s=\sTclCurrCodeOffset();\n\n+\sTclEmitOpcode(INST_END_CATCH,\senvPtr);\s/*\sfor\serror\scase\s*/\n\n\s\s\s\s\s\s}\n\n\s\s}\n\n\nPatchFiles:\n\ntcl/generic/tclCompile.c\n\n\nComments:\n\nnote,\sthis\scode\sin\sCompileExprWord()\sis\sanalagous\sto\scode\sin\sTclCompileExprCmd(),\swhich\sis\salready\scorrect.\n\n\ntests/if.test\sprobably\sneeds\sa\sfew\stestcases\sadded,\ssince\sonly\sa\sfew\sof\sthe\sif-expression\soptimizations\sever\sget\sexercised.\n\n\nand\sin\sgeneral,\sthis\stype\sof\sstack-overflow\serror\swon't\sbe\scaught\sby\sthe\stestsuite,\ssince\sfew\sof\sthe\stests\slive\slong\senough\sto\sseriously\soverflow\sthe\sstack.\n\n\n\n\nNot\sreproducible\sin\slatest\s8.1\scode.
J foundin final:\s8.0.5
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 10.\sObjects
J title compiler\semits\sbad\scode\sfor\s"if"\sexpressions:\scrash\sin\s"set\s
J type Bug
K 218529ffffffffffffffffffffffffffffffffff
U nobody
Z f3fc9ed013f29420f6ce9a1950845c03