diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-11-28 12:06:41 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-11-28 12:06:41 (GMT) |
commit | 18f90309e43e13dde5891a7548dad46e248e2c9a (patch) | |
tree | b2e217691102055a0bd2f5d761a00c640ee0d5aa /generic/tclListObj.c | |
parent | bc23abb929451954a6d17be2d8e22c9fdefbc1bf (diff) | |
download | tcl-18f90309e43e13dde5891a7548dad46e248e2c9a.zip tcl-18f90309e43e13dde5891a7548dad46e248e2c9a.tar.gz tcl-18f90309e43e13dde5891a7548dad46e248e2c9a.tar.bz2 |
Use Tcl_Size for ArithSeries.len
Diffstat (limited to 'generic/tclListObj.c')
-rw-r--r-- | generic/tclListObj.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 486baa2..776ff0e 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -3515,10 +3515,10 @@ UpdateStringOfList( *------------------------------------------------------------------------ */ Tcl_Obj * -TclListTestObj(Tcl_Size length, Tcl_Size leadingSpace, Tcl_Size endSpace) +TclListTestObj(size_t length, size_t leadingSpace, size_t endSpace) { ListRep listRep; - Tcl_Size capacity; + size_t capacity; Tcl_Obj *listObj; TclNewObj(listObj); @@ -3528,11 +3528,14 @@ TclListTestObj(Tcl_Size length, Tcl_Size leadingSpace, Tcl_Size endSpace) if (capacity == 0) { return listObj; } + if (capacity > LIST_MAX) { + return NULL; + } ListRepInit(capacity, NULL, 0, &listRep); ListStore *storePtr = listRep.storePtr; - Tcl_Size i; + size_t i; for (i = 0; i < length; ++i) { TclNewUIntObj(storePtr->slots[i + leadingSpace], i); Tcl_IncrRefCount(storePtr->slots[i + leadingSpace]); |