Skip to content
Tcl Source Code Artifact [8a0b568454]
Login

Artifact [8a0b568454]

Artifact 8a0b5684543cf12fd19b5e5118194c884475718a29f1082ee9b0630161703c63:

Ticket change [8a0b568454] - New ticket [a8579d906a28127d|a8579d906a] <i>&#39;argument with no name&#39; calling proc with args built in different frame</i>. by russell-tcl on 2021-10-06 21:57:42.
D 2021-10-06T21:57:42.521
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment The\sbug\swill\sprobably\snot\sshow\sup\sif\sthe\sargs\slist\sis\s\r\nconstructed\sin\sa\ssingle\sframe.\sThe\scode\sbelow\suses\san\s\r\nexternal\sproc\sto\screate\seach\sarg\swhich\sare\sthen\slappended\s\r\nto\sthe\sfinal\slist\sused,\swith\sor\swithout\sa\sdefault\svalue.\s\r\n\r\nThe\sfirst\sversion\sof\stcl\swhere\sthis\sshows\sup\sis\s8.6.9,\s\r\nwhen\sthe\strampoline\scode\sstarted\sto\sbe\sused.\sI've\stested\s\r\nevery\sreleased\sversion\sof\stcl\ssince,\scompiling\sfrom\ssource.\r\n\r\nThe\serror\soccurs\sin\s8.6.9,10,11\s8.7a5\sand\s9.0a3.\r\nThe\serror\sdoes\snot\soccur\sin\s8.6.8,7,6,5\s8.5.19\sor\s8.4.20.\r\n\r\nThe\smain\splatform\sis\sUbuntu:\suname\s-a\r\n5.11.0-37-generic\s#41-Ubuntu\sSMP\sx86_64\sx86_64\sx86_64\sGNU/Linux\r\n\r\nI\stried\sfollowing\sthe\sprocess\swith\sgdb/VS\sCode\sand\sin\sworking\sand\r\nnon-working\sversions,\sthe\sobjv\sbytes\sis\s0x0\swhen\sthe\sproc\scommands\r\nstarts.\s\r\n\r\nHere's\swhat\smakes\sthe\sbug\sgo\saway:\r\n\r\nIn\sthe\shelper\sproc\sor\sin\sthe\smain\sproc\scall:\r\nllength\s$argName\son\seach\sarg.\r\n\r\nIn\sthe\smain\sproc:\r\nputs\s$argsList\r\n\r\nIf\syou\scatch\sthe\serror\swith\sproc,\syou\scan\sstill\smake\sthe\sbug\r\ngo\saway\susing\sthe\sabove\scalls.\sIf\syou\sjust\srepeat\sthe\ssame\scall\r\nthe\sbug\sis\sstill\sthere.\r\n\r\nI\shave\snot\sfound\sa\sway\sto\srepeat\sthe\sbug\swithout\sa\shelper\sproc.\r\n\r\nHere's\sthe\ssimplified\scode\swhich\sshows\sthe\sbug:\r\n\r\nproc\ssplitArg\s{argSpec\s{splitChar\s!}\s{ArrayName\s""}}\s{\r\n\r\n\s\s\s\sset\sfirstPart\s[lindex\s$argSpec\s0]\r\n\s\s\s\sset\sfirst\s[string\sfirst\s$splitChar\s$firstPart]\r\n\r\n\s\s\s\sif\s{$first\s>\s-1}\s{\r\n\s\s\s\s\s\s\s\sset\sargName\s[string\srange\s$firstPart\s0\s[expr\s{$first\s-\s1}]]\r\n\s\s\s\s\s\s\s\sset\sextra\s[string\srange\s$firstPart\s[expr\s{$first\s+\s1}]\send]\r\n\s\s\s\s}\r\n\s\s\s\sif\s{$ArrayName\seq\s""}\s{\r\n\s\s\s\s\s\s\s\sset\sArrayName\s$argName\s\r\n\s\s\s\s}\r\n\s\s\s\supvar\s$ArrayName\sArgNameArray\s\r\n\r\n\s\s\s\sarray\sset\sArgNameArray\s[lindex\s$argSpec\s1]\r\n\s\s\s\sreturn\s$argName\r\n}\r\n\r\nproc\stestProc\s{procName\sargSpecs\sbody}\s{\r\n\r\n\s\s\s\sset\sargList\s[list]\s\r\n\s\s\s\sforeach\sargSpec\s$argSpecs\s{\r\n\s\s\s\s\s\s\s\sif\s{[array\sexists\sspecArray]}\s{\r\n\s\s\s\s\s\s\s\s\s\s\s\sarray\sunset\sspecArray\r\n\s\s\s\s\s\s\s\s}\r\n\s\s\s\s\s\s\s\sset\sargName\s[splitArg\s$argSpec\s!\sspecArray]\r\n\s\s\s\s\s\s\s\sif\s{[info\sexists\sspecArray(default)]}\s{\r\n\s\s\s\s\s\s\s\s\s\s\s\slappend\sargList\s[list\s$argName\s$specArray(default)]\r\n\s\s\s\s\s\s\s\s}\selse\s{\r\n\s\s\s\s\s\s\s\s\s\s\s\slappend\sargList\s[list\s$argName]\r\n\s\s\s\s\s\s\s\s}\r\n\r\n\s\s\s\s}\r\n\r\n\s\s\s\sproc\s$procName\s$argList\s$body\r\n}\r\n\r\ntestProc\smyproc\s{{arg1!type1\s{default\s"It\sWorks,\sno\sbug\sin\s"}}}\\\r\n\s\s\s\s{puts\s-nonewline\s$arg1;puts\stcl[info\spatchlevel]}\r\n\r\nmyproc
J foundin tcl8.6.9+
J is_private 0
J login russell-tcl
J priority 5\sMedium
J private_contact 746f77a74dfbfc2cb5ae42088bf5906fdc297916
J resolution None
J severity Important
J status Open
J submitter russell-tcl
J subsystem 18.\sCommands\sM-Z
J title 'argument\swith\sno\sname'\scalling\sproc\swith\sargs\sbuilt\sin\sdifferent\sframe
J type Bug
K a8579d906a28127d541ba23f7c1223259f97b123
U russell-tcl
Z 93542101b61b1783bd231e4b7ce0be3c