Skip to content
Tcl Source Code View Ticket
Login

View Ticket

string equal,compare -length option fails for large indices

Closed / Fixeda814ee5bbdb2bbd512397e69704870e14b861985Created 4 years agoUpdated 4 years ago
Descriptionmarkdown2023-04-04 05:40:50

Multiple failure modes when a large length is specified for the -length option to string equal|compare.

% set s1 [string cat [string repeat a 0xfffffffe] X]; string length $s1
4294967295
% set s2 [string cat [string repeat a 0xfffffffe] Y]; string length $s2
4294967295
% string equal -length 0xffffffff $s1 $s2
0 -> correct
% string equal -length 0xfffffffe $s1 $s2
0 -> wrong, should be 1

For larger values of -length , a different error

% string equal -length 0x100000000 a b
integer value too large to represent
Referenced by1
apnadkarni Ticket [a814ee5bbd]: 3 changes [History diff]2023-04-04 08:24:20
apnadkarniplain2023-04-24 16:29:03
Fixed in [e831429a4d]
Log in (anonymous is fine) to add a comment.