Skip to content
Tcl Source Code Artifact [78e42e4f20]
Login

Artifact [78e42e4f20]

Artifact 78e42e4f2099667fe3f21ebaf3052d7c3a14e862ab066c5a1cb46870e8fb0846:

Ticket change [78e42e4f20] - Ticket [154f0982f2f701a1|154f0982f2] <i>Tcl_NewObjectInstance() silently ignores existing namespace argument</i> status still Open with 3 other changes by dkf on 2024-05-23 12:47:48.
D 2024-05-23T12:47:48.174
J icomment There\sare\stwo\sways\swe\scould\svary\sthings\sfrom\show\sthey\sare\snow:\r\n\r\n1.\sMake\s`AllocObject()`\sreturn\s`NULL`\sin\sthis\scase\sand\snot\sreset\sthe\sresult\s(so\sthe\sunderlying\serror\sin\s`Tcl_CreateNamespace()`\scan\sshine\sthrough,\sor\swe\scan\sgenerate\sour\sown\serror;\swe've\sdefinitely\sgot\sa\svalid\s`interp`\sat\sthat\spoint.\s`TclNewObjectInstanceCommon()`\scan\sthen\spass\sthe\sfailure\sout\s(that\sfunction\salready\shas\sfailure\ssemantics\sin\splace\sso\swe\sdon't\sneed\sto\scheck\sits\scallers).\r\n2.\sMake\s`AllocObject()`\scall\s`Tcl_Panic()`\sif\sit\scan't\sallocate\sthe\snamed\snamespace.\sI'm\snot\skeen\son\sthis\soption\sas\sI\ssuspect\sit\swould\smake\sthe\spanic\sdefinitely\sreachable\sfrom\sTcl\sscripts.\r\n\r\nThere\sare\sother\susers\sof\s`AllocObject()`\sbut\sthey\sall\spass\s`NULL`\sfor\s`nsNamePtr`;\sthey\swon't\sgo\sdown\sthis\scode\spath.\sThis\sis\sa\s*total*\saudit\sof\scallers\sof\s`AllocObject()`\sas\sthat\swas,\sis,\sand\salways\swill\sbe\sinternal\sto\s`tclOO.c`;\sthe\sother\scallers\sare\sin\sthe\sfunction\sthat\ssets\sup\sthe\sbase\sof\sthe\sobject\shierarchy.
J login dkf
J mimetype text/x-markdown
K 154f0982f2f701a1c3f964c0a3d54737361a3630
U dkf
Z 146179e8ac61686f02e3559460f287b6