You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vec32 assumes that casting from u32 to usize is always lossless, which is not true on 8-bit or 16-bit platforms and could cause undefined behavior there.
The text was updated successfully, but these errors were encountered:
How about 'index' larger than 2^31 on 32 bit platforms?
That would also be bad. Looking closely I don't think it's possible to trigger, because all allocation is done through std::vec::Vec, which panics if it tries to allocate more than isize::MAX bytes. Since cap can never exceed isize::MAX, and len can never exceed cap, the check that index < len is sufficient.
Vec32
assumes that casting fromu32
tousize
is always lossless, which is not true on 8-bit or 16-bit platforms and could cause undefined behavior there.The text was updated successfully, but these errors were encountered: