Tcl Source Code

View Ticket
Login
Ticket UUID: a97680cbed27a3bb26b82800cdfd662064aa1587
Title: Tcl_FSJoinToPath(): outdated comment
Type: Bug Created on: 2023-07-25 20:57:43
Submitter: chrstphrchvz Assigned to: nobody
Subsystem: 37. File System Severity: Minor
Priority: 5 Medium Last modified: 2023-07-25 20:57:43
Status: Open Closed by: nobody
Resolution: None Closed on:
Version: 8.6.13
Description:

The comment documenting Tcl_FSJoinToPath() says:

 *	The objects in the array given will temporarily have their refCount
 *	increased by one, and then decreased by one when this function exits
 *	(which means if they had zero refCount when we were called, they will
 *	be freed).

This appears to be outdated. It has been documented in 8.7 ([62834021ed4c], https://www.tcl-lang.org/man/tcl8.7/TclLib/FileSystem.html#M47) that the reference counts of values in the objv array must be nonzero. Those reference counts used to be temporarily incremented by Tcl_ListObjAppendElement(), but that was removed in [55c8c6c1552f], and TclJoinPath() currently seems to leave reference counts of inputs as-is.