Skip to content
Tcl Source Code View Ticket
Login

View Ticket

lrepeat cannot create large lists

Closed / Fixed4ce858a0491babcc2da6f3fd094a9dd6e3a89d88Created 4 years agoUpdated 4 years ago
Descriptionmarkdown2023-04-12 16:07:32
% lrepeat 0x100000000 x
integer value too large to represent
% lrepeat 0x80000000 x
bad count "-2147483648": must be integer >= 0
% lrepeat 2147483648 x
bad count "-2147483648": must be integer >= 0

Cause is obvious.

Referenced by1
apnadkarniplain2023-04-12 16:11:52
On a different code path,

```
%     set len [expr 4294967396/8]
536870924
% lrepeat $len 0 1 2 3 4 5 6 7
```

crashes with memory access violation.
apnadkarniplain2023-04-20 16:48:27
Fixed in [fbe4c73160]
Log in (anonymous is fine) to add a comment.