Skip to content
Tcl Source Code View Ticket
Login

View Ticket

lrepeat lacks overflow protection

Closed / Fixed2130992fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2008-09-26 21:01:54
% llength [lrepeat 65536 {*}[lrepeat 65536 a]]
Segmentation fault
dkfplain2008-09-27 21:22:55
We perhaps ought to make the list allocator less inclined to panic() on a failed allocation of the main array, but that's a more disruptive change. (Added an arbitrary limit instead: [lrepeat] won't try to allocate more than 2GB on 32-bit machines now.)
Log in (anonymous is fine) to add a comment.