summaryrefslogtreecommitdiffstats
path: root/doc/ListObj.3
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-05-18 09:05:19 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-05-18 09:05:19 (GMT)
commit98d911931078d5c87ac0468c2a6f43d9c38918cc (patch)
tree3fbc89f1c7bc04bde31ebfd7c5e8766213bf06f5 /doc/ListObj.3
parenta857932d237705bc5fe2b7a0a7474726c32771ed (diff)
downloadtcl-98d911931078d5c87ac0468c2a6f43d9c38918cc.zip
tcl-98d911931078d5c87ac0468c2a6f43d9c38918cc.tar.gz
tcl-98d911931078d5c87ac0468c2a6f43d9c38918cc.tar.bz2
Improve doc: error-handling in Dict/List when > 2**31 elements
Diffstat (limited to 'doc/ListObj.3')
-rw-r--r--doc/ListObj.36
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/ListObj.3 b/doc/ListObj.3
index 09ab3b7..c4aa4bc 100644
--- a/doc/ListObj.3
+++ b/doc/ListObj.3
@@ -153,7 +153,9 @@ address \fIobjcPtr\fR. Similarly, it returns the array pointer by storing
it in the address \fIobjvPtr\fR.
The memory pointed to is managed by Tcl and should not be freed or written
to by the caller. If the list is empty, 0 is stored at \fIobjcPtr\fR
-and NULL at \fIobjvPtr\fR.
+and NULL at \fIobjvPtr\fR. If \fIobjcPtr\fR points to a variable
+of type \fBint\fR and the list contains more than 2**31 elements, the
+function returns \fBTCL_ERROR\fR.
If \fIlistPtr\fR is not already a list value, \fBTcl_ListObjGetElements\fR
will attempt to convert it to one; if the conversion fails, it returns
\fBTCL_ERROR\fR and leaves an error message in the interpreter's result
@@ -163,6 +165,8 @@ Otherwise it returns \fBTCL_OK\fR after storing the count and array pointer.
\fBTcl_ListObjLength\fR returns the number of elements in the list value
referenced by \fIlistPtr\fR.
It returns this count by storing a value in the address \fIlengthPtr\fR.
+If \fIlengthPtr\fR points to a variable of type \fBint\fR and the list
+contains more than 2**31 elements, the function returns \fBTCL_ERROR\fR.
If the value is not already a list value,
\fBTcl_ListObjLength\fR will attempt to convert it to one;
if the conversion fails, it returns \fBTCL_ERROR\fR