From: Ashok N. <apn...@ya...> - 2025-05-01 14:54:47
|
The allocation functions and their calls are not so easy to change for at least two reasons. It breaks the contract with extensions that expect either a panic or a non-NULL return. It is next to impossible to fix all extensions. The other reason is that, even within the core, in some cases the caller itself has no means of returning an error. The most common example is the "UpdateString" procedure of various Tcl_ObjType which generate string representations. These have no status return so if their allocation attempts fail, they have no way to percolate the error up to their caller. Changing the signatures of all functions in the call chain is not feasible. /Ashok ________________________________ From: Kevin Walzer Sent: Thursday, May 1, 2025 7:33 PM To: Jan Nijtmans Cc: Tcl Core List Subject: Re: [TCLCORE] CFV warning: TIP #717: New function: Tcl_AttemptCreateHashEntry() On 5/1/25 8:29 AM, Jan Nijtmans wrote: > The reason for this is that are many calls to Tcl_CreateHashEntry in > the Tcl code > which don't check for NULL values. In stead of panicing, those will crash > without any clue what happened. Why not fix those then? Adding a NEW function to serve this purpose just seems like added complexity to the Tcl core. |